[PyQt] Re: ConvertToSubClass problem

MatteoBertini naufraghi at develer.com
Tue Nov 18 21:44:44 GMT 2008


Phil Thompson <phil <at> riverbankcomputing.com> writes:

> 
> I think you are right. Try changing the line to...
> 
> if (subtype != NULL &&
>     (type == subtype ||
>      !PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)subtype)))
> 
> ...I think.
> 
> Phil
> 

This works as the non ! one, so perhaps they are equivalent.

Lurking in typeobject.c seems that PyType_IsSubtype(a, a) is in fact True

--
Matteo Bertini





More information about the PyQt mailing list