g.brandl-nospam at gmx.net
Mon Nov 6 16:06:11 CET 2006
Paul McGuire wrote:
> "Marc 'BlackJack' Rintsch" <bj_666 at gmx.net> wrote in message
> news:pan.2006.11.06.10.11.35.335058 at gmx.net...
>> In <1162790565.418382.237050 at m73g2000cwd.googlegroups.com>, Simon Wittber
>>> I'd also like to remove any deprecated or stuff which is left in for
>>> backwards functionality (eg Classic classes).
>> Classic classes are still needed for exceptions:
>>>>> class E(object):
>> ... pass
>>>>> raise E
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> TypeError: exceptions must be classes, instances, or strings (deprecated),
>> not type
>> Marc 'BlackJack' Rintsch
> I thought exceptions were converted to new-style classes for Py2.5
Yes, they were. Still, you can't raise instance of arbitrary new-style classes
as exceptions, and you will never be able to. In Py3k, only instances of
"BaseException" subclasses will be raisable.
More information about the Python-list