summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-04-26 07:59:16 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-04-26 07:59:16 (GMT)
commit167c81d5ed5a56a6f05a0786db483b2b73a55a45 (patch)
treeeb15a50a92f26dc5812aa3592c6c19505cf79ba7
parentb31c87bfcfc8b904ef05d998b4c38122b8651763 (diff)
downloadcpython-167c81d5ed5a56a6f05a0786db483b2b73a55a45.zip
cpython-167c81d5ed5a56a6f05a0786db483b2b73a55a45.tar.gz
cpython-167c81d5ed5a56a6f05a0786db483b2b73a55a45.tar.bz2
Issue #23986: Note that the in-operator for lists and tuples check identity before equality.
-rw-r--r--Doc/reference/expressions.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index 1fd37f3..c46ab64 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -1153,7 +1153,7 @@ types to support membership tests without being a sequence. In particular,
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*