From d96f3ac11ea8c4709ec37dd46fc7413f20ed23b3 Mon Sep 17 00:00:00 2001 From: jab Date: Sat, 11 Jan 2020 19:40:37 +0000 Subject: [PATCH] Correct __iter__ docstrings (s/items/keys). --- bidict/_base.py | 2 +- bidict/_delegating.py | 2 +- bidict/_frozenordered.py | 2 +- bidict/_orderedbase.py | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bidict/_base.py b/bidict/_base.py index a5ef609..5376da5 100644 --- a/bidict/_base.py +++ b/bidict/_base.py @@ -378,7 +378,7 @@ class BidictBase(BidirectionalMapping): return len(self._fwdm) def __iter__(self): # lgtm [py/inheritance/incorrect-overridden-signature] - """Iterator over the contained items.""" + """Iterator over the contained keys.""" # No default implementation for __iter__ inherited from Mapping -> # always delegate to _fwdm. return iter(self._fwdm) diff --git a/bidict/_delegating.py b/bidict/_delegating.py index 9e0c5ce..df20183 100644 --- a/bidict/_delegating.py +++ b/bidict/_delegating.py @@ -18,7 +18,7 @@ class _DelegatingMixin: __slots__ = () def __iter__(self): - """Iterator over the contained items.""" + """Iterator over the contained keys.""" return iter(self._fwdm) # pylint: disable=protected-access def keys(self): diff --git a/bidict/_frozenordered.py b/bidict/_frozenordered.py index 00a2620..5d650a0 100644 --- a/bidict/_frozenordered.py +++ b/bidict/_frozenordered.py @@ -45,7 +45,7 @@ class FrozenOrderedBidict(OrderedBidictBase): # mutation. if DICTS_ORDERED: def __iter__(self, reverse=False): # noqa: N802 - """Iterator over the contained items.""" + """Iterator over the contained keys in insertion order.""" if reverse: return super().__iter__(reverse=True) return iter(self._fwdm._fwdm) # pylint: disable=protected-access diff --git a/bidict/_orderedbase.py b/bidict/_orderedbase.py index d4840ad..2d16c87 100644 --- a/bidict/_orderedbase.py +++ b/bidict/_orderedbase.py @@ -271,13 +271,13 @@ class OrderedBidictBase(BidictBase): assert invm[val] is nodeinv def __iter__(self, reverse=False): - """An iterator over this bidict's items in order.""" + """Iterator over the contained keys in insertion order.""" fwdm_inv = self._fwdm.inverse # pylint: disable=no-member for node in self._sntl.__iter__(reverse=reverse): yield fwdm_inv[node] def __reversed__(self): - """An iterator over this bidict's items in reverse order.""" + """Iterator over the contained keys in reverse insertion order.""" for key in self.__iter__(reverse=True): yield key