Hi,
To satisfy my curiosity I was wondering if anyone knew if this
behaviour was intentional?
Is there a specific reason why exceptions are not allowed to be new
style classes?
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
win32[color=blue][color=green][color=darkred]
>>> class OldException: pass
>>> raise OldException()[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
__main__.OldExc eption: <__main__.OldEx ception instance at 0x006AC490>
[color=blue][color=green][color=darkred]
>>> class NewException(ob ject): pass
>>> raise NewException()[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: exceptions must be classes, instances, or strings
(deprecated), not NewException
To satisfy my curiosity I was wondering if anyone knew if this
behaviour was intentional?
Is there a specific reason why exceptions are not allowed to be new
style classes?
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
win32[color=blue][color=green][color=darkred]
>>> class OldException: pass
>>> raise OldException()[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
__main__.OldExc eption: <__main__.OldEx ception instance at 0x006AC490>
[color=blue][color=green][color=darkred]
>>> class NewException(ob ject): pass
>>> raise NewException()[/color][/color][/color]
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: exceptions must be classes, instances, or strings
(deprecated), not NewException
Comment