[Python-Dev] Py3k: Except clause syntax (original) (raw)

skip at pobox.com skip at pobox.com
Fri Mar 17 18:27:41 CET 2006


Skip> try:
Skip>     foo()
Skip> except TypeError with msg, KeyError with msg:
Skip>     print msg

fuzz> Wasn't the proposal :

fuzz> try:
fuzz>     something
fuzz> except NameError, OtherError as e:
fuzz>     something...

I'm not sure. I only saw as|with .

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.

Skip



More information about the Python-Dev mailing list