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.

classification
Title: Not matched behavior of numeric comparison with the documentation
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: benjamin.peterson, docs@python, mark.dickinson, miss-islington, r.david.murray, woo yoo
Priority: normal Keywords: easy, patch

Created on 2016-12-13 04:09 by woo yoo, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5982 merged anthony-flury, 2018-03-05 08:55
PR 9315 merged miss-islington, 2018-09-14 17:49
Messages (5)
msg283069 - (view) Author: woo yoo (woo yoo) Date: 2016-12-13 04:09
According to the documentation, which said "Additionally, comparing any number to a not-a-number value will return False. ",the comparison of `float('nan')!= 1`should yield False, while the result is True.

Small errors like this in documentation should be corrected?

The related link https://docs.python.org/3/reference/expressions.html#value-comparisons
msg283070 - (view) Author: woo yoo (woo yoo) Date: 2016-12-13 04:13
Maybe the description should be changed into "all order comparisons of not-a-number and any number will return False"
msg283096 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-13 11:45
Sure, we like to make the docs more precise when it doesn't interfere with the presentation.  Perhaps something like:  "Additionally, ordering comparisions involving not-a-number values will always return False."

I wonder if we should also mention here that this follows the IEEE standard.
msg325373 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-09-14 17:48
New changeset ad8a0004206ba7aec5a8a60fce413da718080db2 by Benjamin Peterson (Tony Flury) in branch 'master':
closes bpo-28955: Clarified comparisons between NaN and number in reference documentation (GH-5982)
https://github.com/python/cpython/commit/ad8a0004206ba7aec5a8a60fce413da718080db2
msg325377 - (view) Author: miss-islington (miss-islington) Date: 2018-09-14 18:05
New changeset ca2fa2841f8e3ce5213a0e8c0abc1d0fdc7d386b by Miss Islington (bot) in branch '3.7':
closes bpo-28955: Clarified comparisons between NaN and number in reference documentation (GH-5982)
https://github.com/python/cpython/commit/ca2fa2841f8e3ce5213a0e8c0abc1d0fdc7d386b
History
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 73141
2018-09-14 18:05:45miss-islingtonsetnosy: + miss-islington
messages: + msg325377
2018-09-14 17:49:06miss-islingtonsetpull_requests: + pull_request8740
2018-09-14 17:48:54benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg325373

resolution: fixed
stage: patch review -> resolved
2018-03-05 12:06:01serhiy.storchakasetnosy: + mark.dickinson
2018-03-05 08:55:45anthony-flurysetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request5748
2018-03-04 13:22:12cheryl.sabellasetkeywords: + easy
stage: needs patch
type: behavior -> enhancement
versions: + Python 3.7, Python 3.8, - Python 3.5
2016-12-13 11:45:13r.david.murraysetnosy: + r.david.murray
messages: + msg283096
2016-12-13 04:13:07woo yoosetmessages: + msg283070
2016-12-13 04:09:31woo yoocreate