jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/961501 )

Change subject: [mypy] solve typing issue in date.py
......................................................................

[mypy] solve typing issue in date.py

Change-Id: I434e98efd9327c25f04f2428361fdda1c80a9146
---
M pywikibot/date.py
1 file changed, 22 insertions(+), 7 deletions(-)

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




diff --git a/pywikibot/date.py b/pywikibot/date.py
index c344cba..38d9565 100644
--- a/pywikibot/date.py
+++ b/pywikibot/date.py
@@ -69,17 +69,23 @@


 @singledispatch
-def multi(value: int, tuplst: tuplst_type) -> Any:
-    """
-    Run multiple pattern checks for the same entry.
+def multi(value, tuplst: tuplst_type) -> Any:
+    """Run multiple pattern checks for the same entry.

     For example: 1st century, 2nd century, etc.

-    The tuplst is a list of tuples. Each tuple must contain two functions:
-    first to encode/decode a single value (e.g. simpleInt), second is a
-    predicate function with an integer parameter that returns true or false.
-    When the 2nd function evaluates to true, the 1st function is used.
+    The tuplst is a list of tuples. Each tuple must contain two
+    functions: first to encode/decode a single value (e.g. simpleInt),
+    second is a predicate function with an integer parameter that
+    returns true or false. When the 2nd function evaluates to true, the
+    1st function is used.
     """
+    raise NotImplementedError(
+        f'multi funtion is not implemented for type {type(value).__name__}')
+
+
[email protected](int)
+def _(value: int, tuplst: tuplst_type) -> Any:
     # Find a predicate that gives true for this int value, and run a
     # function
     for func, pred in tuplst:

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

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

Reply via email to