From: Raymond Hettinger Date: Wed, 2 Jul 2014 23:30:52 +0000 (+0100) Subject: Fix guidance for subclassing collections.Set() X-Git-Tag: v2.7.9rc1~387 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=809b665b57edccde6418fb9e4a0135a1e629e79a;p=thirdparty%2FPython%2Fcpython.git Fix guidance for subclassing collections.Set() --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 5bb3569dd287..f00b870c9146 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -1028,7 +1028,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin: (2) To override the comparisons (presumably for speed, as the - semantics are fixed), redefine :meth:`__le__` and + semantics are fixed), redefine :meth:`__le__` and :meth:`__ge__`, then the other operations will automatically follow suit. (3) diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index a943263320d2..3d567e388e61 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py @@ -143,7 +143,7 @@ class Set(Sized, Iterable, Container): methods except for __contains__, __iter__ and __len__. To override the comparisons (presumably for speed, as the - semantics are fixed), all you have to do is redefine __le__ and + semantics are fixed), redefine __le__ and __ge__, then the other operations will automatically follow suit. """