[Python-3000] Pre-peps on raise and except changes

Nick Coghlan ncoghlan at gmail.com
Sat Jan 27 16:09:34 CET 2007


Greg Ewing wrote:
> Jim Jewett wrote:
>> it even clears up the pathological
>> case of an object which is both a subclass and an instance of
>> BaseException.
> 
> Is that possible???

Strange but true (Python 2.4):

 >>> class DumbMeta(type, Exception): pass
...
 >>> class WTF(object, Exception):
...     __metaclass__ = DumbMeta
...
 >>> isinstance(WTF, Exception)
True
 >>> issubclass(WTF, Exception)
True

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list