Hi,
2011/4/15 Myles Jackson <[email protected]>:
> I've noticed when trying to compare certain QtCore classes (QPoint, QRect,
> QLine) that the == operator has not been implemented.
>
> Just wondering if this is intentional or an omission?
>
>>>> p = PySide.QtCore.QPoint()
>>>> p == None
Ignoring the fact that this is a bug right now, PEP-8[1] says that you
should use the "is" operator when comparing to None:
- Comparisons to singletons like None should always be done with
'is' or 'is not', never the equality operators.
And this works already (using the Git master branch HEAD from PySide
and Shiboken):
>>> import PySide
>>> p = PySide.QtCore.QPoint()
>>> p is None
False
>>> p is not None
True
HTH.
Thomas
[1] http://www.python.org/dev/peps/pep-0008/
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside