From: Tim Peters Date: Sun, 25 Aug 2002 18:59:04 +0000 (+0000) Subject: Added a clue about why xyz_update isn't the same as __xyz__. X-Git-Tag: v2.3c1~4291 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a2f91e302956ecaa5a70c42b403967e4b261a3d;p=thirdparty%2FPython%2Fcpython.git Added a clue about why xyz_update isn't the same as __xyz__. --- diff --git a/Lib/sets.py b/Lib/sets.py index 3897fb9d7cce..8808701d2447 100644 --- a/Lib/sets.py +++ b/Lib/sets.py @@ -361,7 +361,10 @@ class Set(BaseSet): # We inherit object.__hash__, so we must deny this explicitly 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): """Update a set with the union of itself and another."""