[Python-checkins] cpython (2.7): Issue #23986: Note that the in-operator for lists and tuples check identity
raymond.hettinger
python-checkins at python.org
Tue Apr 26 03:59:21 EDT 2016
https://hg.python.org/cpython/rev/aba647a34ed4
changeset: 101150:aba647a34ed4
branch: 2.7
parent: 101142:c502deb19cb0
user: Raymond Hettinger <python at rcn.com>
date: Tue Apr 26 00:59:16 2016 -0700
summary:
Issue #23986: Note that the in-operator for lists and tuples check identity before equality.
files:
Doc/reference/expressions.rst | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -1153,7 +1153,7 @@
dictionaries (for keys) and sets support membership testing.
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 is y[i]`` or ``x == y[i]`` is true.
For the Unicode and string types, ``x in y`` is true if and only if *x* is a
substring of *y*. An equivalent test is ``y.find(x) != -1``. Note, *x* and *y*
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list