Hi Chris, On 3/12/19 5:07 pm, Christopher Barker wrote:
This is a nonstarter — meaningful indentation is a pretty baked-in ( and liked ) part of the language.
I know. However why not have something that suits even more people. Meaningful indentation is great (and liked here) too... but it could be even better for those valuing that while those who do not don't have to use it.
And yes, it’s been brought up many times before on this list.
Sorry. Newbie here. If being brought up many times, implementing it would be 100% backwards compatible and those relying solely on meaningful indentation can continue to do so .... sounds like a perfect candidate for a PEP to me. Glad to hear I'm not the only one :-)
And it already exists:
for item in a_sequence: do_some_stuff #end for
Yeah. That's I'm doing now. What I'm suggesting does not exist however. The bit that's missing is that the Python interpreter would check that and "end" matches the correct begin.
:-)
-CHB
PS: I’m pretty sure some has written an import hook that does something like this — but mostly as a joke.
Having the interpreter check more at parse time saves a significant amount of time in more complex projects - no joke :-)