Argument-Clinic / cpython

The Python programming language
https://www.python.org/
Other
1 stars 0 forks source link

Refactor `IndentStack`? #9

Open AlexWaygood opened 1 year ago

AlexWaygood commented 1 year ago

We have a bunch of assertions around IndentStack to check that self.margin is not None:

https://github.com/Argument-Clinic/cpython/blob/49f238e78c36532bcbca7f9cd172703eb4df319b/Tools/clinic/clinic.py#L4376

https://github.com/Argument-Clinic/cpython/blob/49f238e78c36532bcbca7f9cd172703eb4df319b/Tools/clinic/clinic.py#L4384

https://github.com/Argument-Clinic/cpython/blob/49f238e78c36532bcbca7f9cd172703eb4df319b/Tools/clinic/clinic.py#L5267

This is a bit of a code smell, but it's hard to immediately see how to fix it.