Don't use the confusing term "set membership".
This commit is contained in:
parent
8ca6c84b6f
commit
489343e948
|
@ -1061,14 +1061,14 @@ Comparison of objects of the same type depends on the type:
|
||||||
another one is made arbitrarily but consistently within one execution of a
|
another one is made arbitrarily but consistently within one execution of a
|
||||||
program.
|
program.
|
||||||
|
|
||||||
The operators :keyword:`in` and :keyword:`not in` test for set membership. ``x
|
The operators :keyword:`in` and :keyword:`not in` test for collection
|
||||||
in s`` evaluates to true if *x* is a member of the set *s*, and false otherwise.
|
membership. ``x in s`` evaluates to true if *x* is a member of the collection
|
||||||
``x not in s`` returns the negation of ``x in s``. The set membership test has
|
*s*, and false otherwise. ``x not in s`` returns the negation of ``x in s``.
|
||||||
traditionally been bound to sequences; an object is a member of a set if the set
|
The collection membership test has traditionally been bound to sequences; an
|
||||||
is a sequence and contains an element equal to that object. However, it is
|
object is a member of a collection if the collection is a sequence and contains
|
||||||
possible for an object to support membership tests without being a sequence. In
|
an element equal to that object. However, it make sense for many other object
|
||||||
particular, dictionaries support membership testing as a nicer way of spelling
|
types to support membership tests without being a sequence. In particular,
|
||||||
``key in dict``; other mapping types may follow suit.
|
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 ``x == y[i]`` is true.
|
||||||
|
|
Loading…
Reference in New Issue