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 rhettinger
Recipients docs@python, eric.araujo, ethan.furman, ezio.melotti, georg.brandl, jonrsharpe, r.david.murray, rhettinger
Date 2015-04-21.02:30:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429583409.32.0.576799115894.issue23987@psf.upfronthosting.co.za>
In-reply-to
Content
There is a separate report for taking care of the identity check for contains:  https://bugs.python.org/issue23986

I think notes about crazy hashes shouldn't spill all over our docs.  At best, it warrants a FAQ entry about how hash tables work.

The risk here is that in an effort to be more precise, it is easy impair the usability of the docs.  The wording in question has been around for a very long time and has overall done a good job of explaining the intent of the in-operator to all but the most pedantic reader, "The operators 'in' and 'not in' test for membership. 'x in s' evaluates to true if x is a member of s, and false otherwise."

If you really want to be precise, the *only* thing that can be broadly stated about the in-operator is that it calls __contains__ on an object that that object can implement whatever logic it wants (hash table lookup, linear search, google search, random result, etc).  But then, this is no different than most magic methods in that regard.
History
Date User Action Args
2015-04-21 02:30:09rhettingersetrecipients: + rhettinger, georg.brandl, ezio.melotti, eric.araujo, r.david.murray, docs@python, ethan.furman, jonrsharpe
2015-04-21 02:30:09rhettingersetmessageid: <1429583409.32.0.576799115894.issue23987@psf.upfronthosting.co.za>
2015-04-21 02:30:09rhettingerlinkissue23987 messages
2015-04-21 02:30:07rhettingercreate