[docs] [issue23986] Inaccuracy about "in" keyword for list and tuple

James Edwards report at bugs.python.org
Fri Apr 17 19:06:31 CEST 2015


James Edwards added the comment:

What about:

 For the list and tuple types, ``x in y`` is true if and only if there exists an
-index *i* such that ``x == y[i]`` is true.
+index *i* such that either ``x == y[i]`` or ``x is y[i]`` is true.

Seems to address your issue, and match the semantics of the Python3 any() approach.

----------
keywords: +patch
nosy: +jedwards
Added file: http://bugs.python.org/file39087/issue23986.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23986>
_______________________________________


More information about the docs mailing list