PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 374 - simple types like QPoint lack a __cmp__ function, making them unhashable
: simple types like QPoint lack a __cmp__ function, making them unhashable
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtGui
: HEAD
: All All
: P3 normal
Assigned To: renato filho
:
:
:
  Show dependency treegraph
 
Reported: 2010-09-21 20:07 EEST by Farsmo
Modified: 2010-10-13 13:48 EEST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Farsmo 2010-09-21 20:07:30 EEST
Example:

p = QtGui.QPoint(42,10)
s = set([p]) # -> fails

It's worth noting that QPoint already has a __hash__ function, so only __cmp__
is missing to make it hashable.

(I'm using Python 2.6)
Comment 1 Marcelo Lira 2010-09-24 17:42:13 EEST
About the example QPoint is a member of the QtCore module:

p = QtCore.QPoint(42,10)
Comment 2 Marcelo Lira 2010-09-28 15:29:13 EEST
Fixed in commit PySide/4787f1eb.

Hash functions were added to QLine, QPoint, QRect and QSize classes.
See bug 391 for a floating point version of this bug.
Comment 3 renato filho 2010-10-13 13:48:54 EEST
released on PySide 0.4.2