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

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
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/F5PY6NQEVG6RKVPSSTIERRG42OCYKRVB/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to