[Python-Dev] Py3k: Except clause syntax
John J Lee
jjl at pobox.com
Fri Mar 17 20:44:51 CET 2006
More information about the Python-Dev mailing list
Fri Mar 17 20:44:51 CET 2006
- Previous message: [Python-Dev] Py3k: Except clause syntax
- Next message: [Python-Dev] Py3k: Except clause syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 17 Mar 2006, skip at pobox.com wrote: [...] > fuzz> Wasn't the proposal : > > fuzz> try: > fuzz> something > fuzz> except NameError, OtherError as e: > fuzz> something... > > I'm not sure. I only saw <SomeError> as|with <SomeValue>. Fuzzyman is right. > In your formulation the comma binds more tightly than the as keyword. > In import statements it's the other way around. That seems like it > might be a source of confusion. Perhaps parentheses around the exception list should be mandatory for the 2-or-more exceptions case? except NameError as e: --> fine except (NameError) as e: --> fine except (NameError,) as e: --> fine except NameError, OtherError as e: --> SyntaxError except (NameError, OtherError) as e: --> fine John
- Previous message: [Python-Dev] Py3k: Except clause syntax
- Next message: [Python-Dev] Py3k: Except clause syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list