mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Added a clue about why xyz_update isn't the same as __xyz__.
This commit is contained in:
parent
ea76c98014
commit
4a2f91e302
1 changed files with 4 additions and 1 deletions
|
@ -361,7 +361,10 @@ class Set(BaseSet):
|
||||||
# We inherit object.__hash__, so we must deny this explicitly
|
# We inherit object.__hash__, so we must deny this explicitly
|
||||||
raise TypeError, "Can't hash a Set, only an ImmutableSet."
|
raise TypeError, "Can't hash a Set, only an ImmutableSet."
|
||||||
|
|
||||||
# In-place union, intersection, differences
|
# In-place union, intersection, differences.
|
||||||
|
# Subtle: The xyz_update() functions deliberately return None,
|
||||||
|
# as do all mutating operations on built-in container types.
|
||||||
|
# The __xyz__ spellings have to return self, though.
|
||||||
|
|
||||||
def __ior__(self, other):
|
def __ior__(self, other):
|
||||||
"""Update a set with the union of itself and another."""
|
"""Update a set with the union of itself and another."""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue