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

Matt matthew_shomphe at countrywide.com
Fri May 13 21:30:31 EDT 2005


Bengt Richter wrote:
> 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

Great googling!  Reading through to the end it seems that there will be
a patch for 2.5:
http://sourceforge.net/tracker/index.php?func=detail&aid=1104669&group_id=5470&atid=305470
(although from the thread you found, it appears to be somewhat
temporary in case everything starts breaking :-)   )




More information about the Python-list mailing list