From: Raymond Hettinger Date: Wed, 2 Jul 2014 23:31:30 +0000 (+0100) Subject: Fix guidance for subclassing collections.Set() X-Git-Tag: v3.4.2rc1~269 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=11cda4766108c3220402c5a430573a1288a1b4ac;p=python Fix guidance for subclassing collections.Set() --- diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst index 356f47332f..0bb26f938f 100644 --- a/Doc/library/collections.abc.rst +++ b/Doc/library/collections.abc.rst @@ -173,7 +173,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/_collections_abc.py b/Lib/_collections_abc.py index 656ae064fe..647744491d 100644 --- a/Lib/_collections_abc.py +++ b/Lib/_collections_abc.py @@ -183,7 +183,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. """