Kaydet (Commit) 167c81d5 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Issue #23986: Note that the in-operator for lists and tuples check identity before equality.

üst b31c87bf
...@@ -1153,7 +1153,7 @@ types to support membership tests without being a sequence. In particular, ...@@ -1153,7 +1153,7 @@ types to support membership tests without being a sequence. In particular,
dictionaries (for keys) and sets support membership testing. 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 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 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* substring of *y*. An equivalent test is ``y.find(x) != -1``. Note, *x* and *y*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment