-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
bpo-32118: Simplify docs for sequence comparison #15450
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. It add something useful about singletons. The condensed replacement is better than what I vaguely suggested. I agree that the second sentence gives the essential what -- what people need to know about what Python does to write successful code.
I considered whether 'internal invariants' should be expanded. The main one is that an object put into a sequence should be seen as in the sequence. But anything about that really belongs in discussion of 'in' and '__contains__'
. I decided that the 3rd sentence is sufficient justification as is for why Python makes the stated assumption.
Thanks @rhettinger for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
(cherry picked from commit edd2112) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
GH-15466 is a backport of this pull request to the 3.8 branch. |
This section had become a mess, focusing on a pathological case and not clearly specifying the essential behavior: "sequences bypass equality checks for identical objects".
NaN behavior is already covered elsewhere.
https://bugs.python.org/issue32118