]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46270: Describe the `in` and `not in` operators as membership tests. (GH-30504)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Mon, 10 Jan 2022 02:02:06 +0000 (20:02 -0600)
committerGitHub <noreply@github.com>
Mon, 10 Jan 2022 02:02:06 +0000 (18:02 -0800)
Doc/tutorial/datastructures.rst

index e42b380db3d23ca694a197531f0fca1739e977d7..927a6722ca2514f9a3e4c09b03d7c9b48ef39ee7 100644 (file)
@@ -659,10 +659,12 @@ More on Conditions
 The conditions used in ``while`` and ``if`` statements can contain any
 operators, not just comparisons.
 
-The comparison operators ``in`` and ``not in`` check whether a value occurs
-(does not occur) in a sequence.  The operators ``is`` and ``is not`` compare
-whether two objects are really the same object.  All comparison operators have
-the same priority, which is lower than that of all numerical operators.
+
+The comparison operators ``in`` and ``not in`` are membership tests that
+determine whether a value is in (or not in) a container.  The operators ``is``
+and ``is not`` compare whether two objects are really the same object.  All
+comparison operators have the same priority, which is lower than that of all
+numerical operators.
 
 Comparisons can be chained.  For example, ``a < b == c`` tests whether ``a`` is
 less than ``b`` and moreover ``b`` equals ``c``.