This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Electro
Recipients Electro
Date 2014-06-26.08:23:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403771009.56.0.175285571524.issue21873@psf.upfronthosting.co.za>
In-reply-to
Content
While searching for a way to work around the breakage of the Schwartzian transform in Python 3 (and the resulting awkwardness if you wish to use heapq or bisect, which do not yet have a key argument), I thought of the good old IEEE-754 NaN. Unfortunately, that shouldn't work since lexicographical comparisons shouldn't stop for something comparing False all the time. Nevertheless:

>>> (1, float("nan"), A()) < (1, float("nan"), A())
False
>>> (0, float("nan"), A()) < (1, float("nan"), A())
True

Instead of as in
>>> nan = float("nan")
>>> (1, nan, A()) < (1, nan, A())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unorderable types: A() < A()

(As a side note, PyPy3 does not have this bug.)
History
Date User Action Args
2014-06-26 08:23:29Electrosetrecipients: + Electro
2014-06-26 08:23:29Electrosetmessageid: <1403771009.56.0.175285571524.issue21873@psf.upfronthosting.co.za>
2014-06-26 08:23:29Electrolinkissue21873 messages
2014-06-26 08:23:28Electrocreate