Skip to content

Commit

Permalink
few mypy fixes in quickdic6.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Dec 3, 2023
1 parent d19c097 commit 65a0ed1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyglossary/plugins/quickdic6.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,9 +698,13 @@ def clear(self) -> None:
self._dic = None

def __len__(self) -> int:
if self._dic is None:
return 0
return sum(len(p) for _, p in self._dic.pairs) + len(self._dic.htmls)

def __iter__(self) -> "typing.Iterator[EntryType]":
if self._dic is None:
raise RuntimeError("dictionary not open")
for idx, (_, pairs) in enumerate(self._dic.pairs):
syns = self._synonyms.get((0, idx), set())
for word, defi in pairs:
Expand Down

0 comments on commit 65a0ed1

Please sign in to comment.