Message280080
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 |
|
Date |
User |
Action |
Args |
2016-11-04 20:36:00 | wim.glenn | set | recipients:
+ wim.glenn, docs@python |
2016-11-04 20:36:00 | wim.glenn | set | messageid: <1478291760.05.0.758080389861.issue28617@psf.upfronthosting.co.za> |
2016-11-04 20:35:59 | wim.glenn | link | issue28617 messages |
2016-11-04 20:35:59 | wim.glenn | create | |
|