[Python-ideas] Add "goto fail" to Python?

Yann Kaiser kaiser.yann at gmail.com
Thu Mar 6 22:41:56 CET 2014


What does this add that we can't do with control flow tools such as
try..finally or context managers?

On 6 March 2014 22:36, Georg Brandl <g.brandl at gmx.net> wrote:
> Am 06.03.2014 11:11, schrieb Nick Coghlan:
>>
>> On 6 Mar 2014 13:55, "Sturla Molden"
>> <sturla.molden at gmail.com
>> <mailto:sturla.molden at gmail.com>> wrote:
>>>
>>> "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/lib/sslKeyExchange.c
>>>
>>>
>> https://www.gitorious.org/gnutls/gnutls/source/6aa26f78150ccbdf0aec1878a41c17c41d358a3b:lib/x509/verify.c
>>>
>>> I believe Python needs to add support for this superior paradigm.
>>
>> Unfortunately, we can't throw stones about those, since we currently have
>> hostname matching off by default and expect developers to turn it on.
>
> And on another level, we use the same error handling method in C code
> (which is not bad per se of course).  The literal code "goto fail;" actually
> occurs about 200 times in the CPython sources :)
>
> Aaand... we also don't have a policy to always use braces...
>
> Georg
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/


More information about the Python-ideas mailing list