Author wim.glenn
Recipients docs@python, wim.glenn
Date 2016-11-04.20:35:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478291760.05.0.758080389861.issue28617@psf.upfronthosting.co.za>
In-reply-to
Content
Regarding 

    https://docs.python.org/3/library/stdtypes.html#comparisons

There is a line at the bottom claiming:

> Two more operations with the same syntactic priority, in and not in, are supported only by sequence types (below).

The claim is incorrect because `in` and `not in` are also supported by non-sequence types such as sets, mappings, etc for membership testing.

Is there any good reason why we don't include them in the table of comparison operations, and say that there are ten comparison operations in python?  They do support comparison chaining in the same way: 

    >>> 'x' in 'xy' in 'xyz'
    True
    >>> 0 in {0} in [{0}]
    True
History
Date User Action Args
2016-11-04 20:36:00wim.glennsetrecipients: + wim.glenn, docs@python
2016-11-04 20:36:00wim.glennsetmessageid: <1478291760.05.0.758080389861.issue28617@psf.upfronthosting.co.za>
2016-11-04 20:35:59wim.glennlinkissue28617 messages
2016-11-04 20:35:59wim.glenncreate