[Python-ideas] except expression

Jan Kaliszewski zuo at chopin.edu.pl
Mon Feb 17 15:10:07 CET 2014


W dniu 17.02.2014 10:56, Paul Moore napisaƂ(a):

[...]
>>> >     some_io() except (FileNotFoundError: (1, 2, 3),
>>> >                       (ValueError, TypeError): 'spam')
>
> is precisely that - the subtle change in meaning based on a 
> relatively
> hard to spot colon
[...]

Please note that in case of the cited example (of the syntax variant
proposed by me, i.e. the parens-after-except one) colon does not
provide a subtle change but constitutes the whole expression syntax
-- without the colon(s) it would just cause SytaxError.

Cheers.
*j



More information about the Python-ideas mailing list