Kaydet (Commit) 809b665b authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Fix guidance for subclassing collections.Set()

üst f6b3c84a
...@@ -1028,7 +1028,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin: ...@@ -1028,7 +1028,7 @@ Notes on using :class:`Set` and :class:`MutableSet` as a mixin:
(2) (2)
To override the comparisons (presumably for speed, as the 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. then the other operations will automatically follow suit.
(3) (3)
......
...@@ -143,7 +143,7 @@ class Set(Sized, Iterable, Container): ...@@ -143,7 +143,7 @@ class Set(Sized, Iterable, Container):
methods except for __contains__, __iter__ and __len__. methods except for __contains__, __iter__ and __len__.
To override the comparisons (presumably for speed, as the 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. then the other operations will automatically follow suit.
""" """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment