[Python-ideas] except expression

Philipp A. flying-sheep at web.de
Thu Feb 13 19:54:37 CET 2014


mainly, a colon introduces a block, which is why i don’t like the colon
variant of this expression.


2014-02-13 19:47 GMT+01:00 spir <denis.spir at gmail.com>:

> On 02/13/2014 07:43 PM, Amber Yust wrote:
>
>> Actually. What if we just reused 'try'?
>>
>>      foo = bar() except BazException try 'qux'
>>
>> This also leads naturally to chaining multiple possible fallbacks:
>>
>>      foo = bar() except BarException try baz() except BazException try
>> None
>>
>
> I like it. Especially because 'try' already works with 'except'. (But note
> that 'try', like my proposal of 'then', normally introduces a block).
>
>
> d
> _______________________________________________
> 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/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140213/d30c2ea4/attachment.html>


More information about the Python-ideas mailing list