Skip to content

Commit d24cd49

Browse files
authored
bpo-46270: Describe the in and not in operators as membership tests. (GH-30504)
1 parent 0b2b9d2 commit d24cd49

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Doc/tutorial/datastructures.rst

+6-4
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,12 @@ More on Conditions
659659
The conditions used in ``while`` and ``if`` statements can contain any
660660
operators, not just comparisons.
661661

662-
The comparison operators ``in`` and ``not in`` check whether a value occurs
663-
(does not occur) in a sequence. The operators ``is`` and ``is not`` compare
664-
whether two objects are really the same object. All comparison operators have
665-
the same priority, which is lower than that of all numerical operators.
662+
663+
The comparison operators ``in`` and ``not in`` are membership tests that
664+
determine whether a value is in (or not in) a container. The operators ``is``
665+
and ``is not`` compare whether two objects are really the same object. All
666+
comparison operators have the same priority, which is lower than that of all
667+
numerical operators.
666668

667669
Comparisons can be chained. For example, ``a < b == c`` tests whether ``a`` is
668670
less than ``b`` and moreover ``b`` equals ``c``.

0 commit comments

Comments
 (0)