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
containers "same" does not always mean "__eq__". #66200
Comments
https://docs.python.org/3.5/reference/expressions.html#not-in Containers are permitted to (and generally do) read "same as" as "is or __eq__), which can be confusing -- particularly in the section defining __eq__. Several suggested changes: """ also: """ I *think* it is OK to leave that caveat out of the mapping case, because "have the same (key, value) pairs" would now refer to the above. |
On Thu, Jul 17, 2014 at 07:39:21PM +0000, Jim Jewett wrote:
We can't say "will normally", since we don't know about the infinite |
"must be identical" sounds like "identical twins". I think what you mean is "must be references to the same object or to objects that compare equal". If you don't want to get into the concept of 'references' here, I suppose it could read "must be the same object or objects that compare equal". What I'm saying is that "same object" is stronger than "identical"..."identical" is much closer to "equal" in English. |
Ah... "be the same object or compare equal" sounds much better. I don't want "same" to sound like an informal wording for equal, because |
Yes, the plain language is clear and reads nicely.
"general containers may" is most accurate.
Jim, can you propose a much more minimal edit? As you pointed-out, the underlying logic is "containers are permitted to (and generally do) read "same as" as "is or __eq__". I don't think we should say much more than that in the section on expressions. Any notes on NaNs should probably be in a section talking about the float type. The weirdness of NaNs is a feature of the NaNs, not a feature of the entire language. We definitely don't want a NaN note added to the documentation of every container. |
bpo-12067 has a large patch in progress that would conflict with the changes suggested here. However most of the concerns here may already be addressed there, if the patch ever goes ahead. |
I reviewed the issues discussed here and believe that the patch for #bpo-12067 adresses all of them (and yes, it is large, unfortunately). Andy |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: