03.12.19 02:02, Jan Bakuwel пише:

To include optional "end if", "end while", "end for" and "end <function name>", "end <class name>" in the language. The Python interpreter would test that any "end" matches with the correct corresponding statements and have the correct indentation, in other words throw an error if you would write "end if" where an "end while" should be. This will be a great help preventing errors with procedural logic, that I now have to painstakingly debug at runtime, especially after moving bits of code around.

Look at Tools/scripts/pindent.py. It allows to add directives like "# end for". You can write a script which checks that all "# end" directives are correct (it can also be added as an option in pindent.py).
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
Message archived at 
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to