Message9299
Logged In: YES
user_id=89016
What about the following patch (diff.txt):
It allows new style objects as exceptions and makes catching
exceptions by basetype possible:
class newint(int):
pass
try:
raise newint(42)
except int, exc:
print exc
With this patch subinstances of str become raisable and will
be caught be type not identity. This could be changed to
explicitely forbid str subinstances.
And
raise type(None), None
becomes ambiguous: It is interpreted as
raise type(None)
i.e. it raises the type(None) object as an exception, not
the object None (which is of type type(None))
As soon as Exception is a new style class we could limit the
allowed objects to (sub)instances of Exception. |
|
Date |
User |
Action |
Args |
2007-08-23 13:59:16 | admin | link | issue518846 messages |
2007-08-23 13:59:16 | admin | create | |
|