[Brett]
I gave a talk last night at the Vancouver Python users group on
2.6/3.0, and I tried the following code and it failed during a live
demo::
>>> try: pass
... except Exception, Exception: pass
File "<stdin>", line 2
except Exception, Exception: pass
^
SyntaxError: invalid syntax
Now from what I can tell from PEP 3110, that should be legal in 3.0.
Am I reading the PEP correctly?
Don't think so.
The parens are necessary for a tuple of exceptions
lest it be confused with the old "except E, v" syntax
which meant "except E as e".
Maybe in 3.1, the paren requirement can be dropped.
But for 3.0, it would be a problem given that old
scripts would start getting misinterpreted.
I did something similar for list.sort() by requiring
keyword arguments. That way, we wouldn't have
list.sort(f) running with f as a cmp function 2.6 and
as a key function in 3.0.
Raymond
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com