homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Would be nice to have a future import that turned off old except style
Type: enhancement Stage:
Components: Interpreter Core Versions: Python 2.7
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: Zaheer.Merali, benjamin.peterson, ezio.melotti
Priority: normal Keywords:

Created on 2012年01月11日 13:24 by Zaheer.Merali, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Messages (3)
msg151058 - (view) Author: Zaheer Merali (Zaheer.Merali) Date: 2012年01月11日 13:24
It would be nice to have a future import to be able to prevent people in code doing:
try:
 ....
except Exception, e:
 ....
and make people do:
try:
 ....
except Exception as e:
 ....
msg151059 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2012年01月11日 14:00
If you run python with the -3 flag you should get a warning about that. If you combine it with -We you should be able to get an error instead of a warning. Note however that both the flags are not specific for the "except" but also generate/affect other warnings as well.
msg151060 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2012年01月11日 14:05
Unfortunately, that would be a new feature, so it is not acceptable to Python 2.7.
History
Date User Action Args
2022年04月11日 14:57:25adminsetgithub: 57976
2012年01月11日 14:05:38benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg151060

resolution: rejected
2012年01月11日 14:00:30ezio.melottisetnosy: + ezio.melotti
messages: + msg151059
2012年01月11日 13:24:51Zaheer.Meralicreate

AltStyle によって変換されたページ (->オリジナル) /