jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1203213?usp=email )

Change subject: mypy: fix mypy issues in tools/itertools.py
......................................................................

mypy: fix mypy issues in tools/itertools.py

Change-Id: Ia2067365f6ea44050f46fbe5d247dc7b3d577bca
---
M .pre-commit-config.yaml
M conftest.py
M pywikibot/tools/itertools.py
3 files changed, 4 insertions(+), 3 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified




diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 0447dc4..9f40df6 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -135,6 +135,6 @@
             pagegenerators/(__init__|_filters)|
             scripts/(?:i18n/)?__init__|
             
site/(__init__|_basesite|_decorators|_interwikimap|_tokenwallet|_upload)|
-            tools/(_deprecate|_logging|_unidata|chars|formatter)|
+            tools/(_deprecate|_logging|_unidata|chars|formatter|itertools)|
             
userinterfaces/(__init__|_interface_base|buffer_interface|terminal_interface|transliteration)
           )\.py$
diff --git a/conftest.py b/conftest.py
index b4a7b8d..544f800 100644
--- a/conftest.py
+++ b/conftest.py
@@ -27,7 +27,7 @@
     r'scripts/(i18n/)?__init__|'
     r'site/(__init__|_basesite|_decorators|_interwikimap|'
     r'_tokenwallet|_upload)|'
-    r'tools/(_deprecate|_logging|_unidata|chars|formatter)|'
+    r'tools/(_deprecate|_logging|_unidata|chars|formatter|itertools)|'
     r'userinterfaces/(__init__|_interface_base|buffer_interface|'
     r'terminal_interface|transliteration)'
     r')\.py'
diff --git a/pywikibot/tools/itertools.py b/pywikibot/tools/itertools.py
index b06f6bf..7937989 100644
--- a/pywikibot/tools/itertools.py
+++ b/pywikibot/tools/itertools.py
@@ -13,7 +13,7 @@
 import collections
 import heapq
 import itertools
-from collections.abc import Callable, Generator, Iterable, Iterator
+from collections.abc import Callable, Generator, Hashable, Iterable, Iterator
 from contextlib import suppress
 from typing import Any

@@ -152,6 +152,7 @@

     # Item is cached to check that it is found n_gen times
     # before being yielded.
+    cache: collections.defaultdict[Hashable, collections.Counter[int]]
     cache = collections.defaultdict(collections.Counter)
     n_gen = len(iterables)


--
To view, visit 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1203213?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia2067365f6ea44050f46fbe5d247dc7b3d577bca
Gerrit-Change-Number: 1203213
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to