Add "goto fail" to Python?
"goto fail" is a well-known error handling mechanism in open source software, widely reputed for its robusteness: http://opensource.apple.com/source/Security/Security-55471/libsecurity_ssl/l... https://www.gitorious.org/gnutls/gnutls/source/6aa26f78150ccbdf0aec1878a41c1... I believe Python needs to add support for this superior paradigm. It would involve a new keyword "fail" and some means of goto'ing to it. I suggest "raise to fail": if (some_error): raise to fail fail: <error handling code> Unless there are many objections, this fantastic idea might be submitted in a (short) PEP somewhere around the beginning of next month. There is some obvious overlap with the rejected "goto PEP" (PEP 3163) and the Python 2.3 goto module. However, the superiority of goto fail as error generation and error handling paradigm has since then been thoroughly proven. http://legacy.python.org/dev/peps/pep-3136/ http://entrian.com/goto/download.html Regards, Sturla Molden
participants (9)
-
Barry Warsaw
-
David Mertz
-
Georg Brandl
-
Nick Coghlan
-
Ryan
-
Steven D'Aprano
-
Sturla Molden
-
Westley MartÃnez
-
Yann Kaiser