Skip to content

bpo-39530: Fix misleading statement about mixed-type numeric comparisons #18615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2020

Conversation

mdickinson
Copy link
Member

@mdickinson mdickinson commented Feb 23, 2020

There's a misleading statement in the documentation that suggests that (for example) an integer-to-float comparison is performed by first converting the integer to a float and then comparing the floats. This PR fixes that statement.

https://bugs.python.org/issue39530

Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also misinterpreted the old comparison sentence. The replacement sentence explains the seeming contradiction in

>>> n = 2**64 + 400; n > n + 1.5
True

'narrower' is perhaps not the best term, but it is a) standard, b) explained well enough in context, and c) a different issue.

@mdickinson
Copy link
Member Author

'narrower' is perhaps not the best term

Agreed; I'd be happy to see a rewording of the entire paragraph, but that's lower priority than fixing the incorrect information.

@mdickinson mdickinson merged commit 9f1cb1b into python:master Mar 2, 2020
@miss-islington
Copy link
Contributor

Thanks @mdickinson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 2, 2020
@bedevere-bot
Copy link

GH-18736 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 2, 2020
@bedevere-bot
Copy link

GH-18737 is a backport of this pull request to the 3.7 branch.

ned-deily pushed a commit that referenced this pull request Mar 3, 2020
@miss-islington
Copy link
Contributor

Thanks @mdickinson for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 4, 2020
@bedevere-bot
Copy link

GH-18773 is a backport of this pull request to the 3.8 branch.

mdickinson added a commit that referenced this pull request Mar 4, 2020
…) (#18773)

(cherry picked from commit 9f1cb1b)

Co-authored-by: Mark Dickinson <[email protected]>

Co-authored-by: Mark Dickinson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants