isinstance is broken

Steve Holden sholden at
Sun Jan 19 23:07:43 CET 2003

"Michele Simionato" <mis6 at> wrote in message
news:2259b0e2.0301181542.5264be68 at
[ ... ]
> Here I don't feel stupid; I didn't know that. You are saying essentially
> that c *does* inherit __new__ from object, but it cannot be accessed with
> c.__new__ due to an implementation detail (i.e. getattr looks for
> which is not there); it can be accessed via type(c) anyway.
> This is an inconsistency of old style classes: they inherits from object
> but you cannot access object methods in the usual way.
Indeed, old-style classes were the *only* inheritacnce mechanism until
fairely recently. Python is in the middle of what's usually referred to as
"type/class unification": when that effort's completed, the inconsistency
will go away, as all user-defined classes will inherit directly or
indirectly from object.

> Thanks to everybody for the explanations,
One of the nice parts about hanging round

Steve Holden                        
Python Web Programming       
Bring your musical instrument to PyCon!

More information about the Python-list mailing list