How to find the classname of an object? (was Python Documentation)

Bengt Richter bokr at oz.net
Fri May 13 19:55:36 EDT 2005


On 13 May 2005 14:59:13 -0700, "Matt" <matthew_shomphe at countrywide.com> wrote:
>
>Bengt Richter wrote:
[...]
>> I'm afraid inheriting explicitly from object will make the exception
>unraisable.
>> Exceptions are still based on "classic" classes for some reason that
>> I don't know enough about to explain.
>>
>> So if you were hoping to use .mro() with old-style classes to see the
>> old-style inheritance chain, as opposed to new-style inheritance that
>> underlies access to special entities involved in the implementation
>of the old, sorry ;-/
>>
>> At least that's the way it looks to me, without digging in that part
>of the code.
>>
>> Regards,
>> Bengt Richter
>
>D'oh!  So I tested the .mro() functionality but not the
>Exception-raisableness (?).
>
>It seems unintuitive to me as to why inheriting from  "object" would
>prevent something that also inherited from "Exception" from being
>raised.  Does anyone have insight into why this happens?
>
I googled for some discussion and found something straight from the BDFL:

    http://mail.python.org/pipermail/python-dev/2005-January/051098.html

with a lot of interesting followup. Don't know what the status of the
patch is now.

Regards,
Bengt Richter



More information about the Python-list mailing list