classification
Title: WeakSet has ordering relations wrong
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: meador.inge, pitrou, python-dev, rhettinger
Priority: high Keywords: patch

Created on 2012-03-04 20:28 by pitrou, last changed 2012-03-05 04:44 by meador.inge. This issue is now closed.

Files
File name Uploaded Description Edit
issue14195-v1.patch meador.inge, 2012-03-05 00:45 review
Messages (4)
msg154910 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-03-04 20:28
>>> a = weakref.WeakSet()
>>> a < a
True
>>> a > a
True
msg154918 - (view) Author: Meador Inge (meador.inge) * (Python committer) Date: 2012-03-05 00:45
Ouch, WeakSet.__lt__ and WeakSet.__gt__ are defined in terms of set.issubset and set.issuperset, respectively.  set.issubset and set.issuperset are *not* proper subset and superset operations, thus the error.  The attached patch fixes this.
msg154919 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2012-03-05 00:55
+1 thanks for fixing this
msg154920 - (view) Author: Roundup Robot (python-dev) Date: 2012-03-05 04:43
New changeset 4b3f1decb1af by Meador Inge in branch '2.7':
Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive.
http://hg.python.org/cpython/rev/4b3f1decb1af

New changeset 5b88475aae96 by Meador Inge in branch '3.2':
Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive.
http://hg.python.org/cpython/rev/5b88475aae96

New changeset 31dc8fe15b02 by Meador Inge in branch 'default':
Issue #14195: Make WeakSet.__lt__ and WeakSet.__gt__ irreflexive.
http://hg.python.org/cpython/rev/31dc8fe15b02
History
Date User Action Args
2012-03-05 04:44:55meador.ingesetstatus: open -> closed
resolution: fixed
stage: needs patch -> resolved
2012-03-05 04:43:35python-devsetnosy: + python-dev
messages: + msg154920
2012-03-05 00:55:12rhettingersetpriority: normal -> high
nosy: + rhettinger
messages: + msg154919

2012-03-05 00:45:10meador.ingesetfiles: + issue14195-v1.patch

nosy: + meador.inge
messages: + msg154918

keywords: + patch
2012-03-04 20:28:39pitroucreate