[PyKDE] segfault using hasattr on a wrappertype class

Phil Thompson phil at riverbankcomputing.co.uk
Wed Oct 19 08:03:54 BST 2005


On Tuesday 18 October 2005 11:12 pm, Giovanni Bajo wrote:
> Phil Thompson <phil at riverbankcomputing.co.uk> wrote:
> >> behaviour:
> >>>>> import sip
> >>>>> isinstance(sip.wrapper, object)
> >>
> >> True
> >>
> >>>>> issubclass(sip.wrapper, object)
> >>
> >> True
> >>
> >> Dunno if it's related to the fix.
> >
> > Why is it strange?
>
> It's uncommon for an object to both be an instance *and* a subclass of a
> given class. What other object in Python has the same property?

isinstance(type([]), object)
True
issubclass(type([]), object)
True

isinstance(type(1), object)
True
issubclass(type(1), object)
True

...etc, etc.

Phil




More information about the PyQt mailing list