Message191258
Obviously it can't be required that the index be provided as that would break way too much code. There are already exceptions in the stdlib that have optional attributes you can choose to (not) set.
As for relying upon it, it would be just like any other object that gets a new attribute: either you rely on it because you know the code you are using always provides it (e.g. using core/stdlib code directly) or you use some way to deal with cases where it was not set (EAFP or LBYL). Subclassing IndexError to provide a inheritance guarantee that an attribute exists seems like overkill (e.g. IndexError2 so you can do ``except IndexError2 as exc:``). |
|
Date |
User |
Action |
Args |
2013-06-16 04:29:06 | brett.cannon | set | recipients:
+ brett.cannon, barry, rhettinger, ezio.melotti, eric.araujo, cvrebert |
2013-06-16 04:29:05 | brett.cannon | set | messageid: <1371356945.97.0.955468989022.issue18162@psf.upfronthosting.co.za> |
2013-06-16 04:29:05 | brett.cannon | link | issue18162 messages |
2013-06-16 04:29:05 | brett.cannon | create | |
|