New submission from wim glenn:
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
----------
assignee: docs@python
components: Documentation
files: patch.diff
keywords: patch
messages: 280080
nosy: docs@python, wim.glenn
priority: normal
severity: normal
status: open
title: Why isn't "in" called a comparison operation?
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45359/patch.diff
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28617>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com