typing: switch an argument type to the generic form stable
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 11 Mar 2021 17:02:28 -0500
branchstable
changeset 46682 8f8fce2dd594
parent 46681 ae62ab82a345
child 46683 b0253377e170
typing: switch an argument type to the generic form This fixes the following pytype complaint: File "/mnt/c/Users/Matt/hg/mercurial/commands.py", line 4672, in log: Function mercurial.logcmdutil.parseopts was called with the wrong arguments [wrong-arg-types] Expected: (ui, pats: List[Union[bytearray, bytes, memoryview]], ...) Actually passed: (ui, pats: tuple, ...) Differential Revision: https://phab.mercurial-scm.org/D10167
mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py	Thu Mar 11 21:25:28 2021 -0500
+++ b/mercurial/logcmdutil.py	Thu Mar 11 17:02:28 2021 -0500
@@ -51,6 +51,7 @@
         Dict,
         List,
         Optional,
+        Sequence,
         Tuple,
     )
 
@@ -723,7 +724,7 @@
 
 
 def parseopts(ui, pats, opts):
-    # type: (Any, List[bytes], Dict[bytes, Any]) -> walkopts
+    # type: (Any, Sequence[bytes], Dict[bytes, Any]) -> walkopts
     """Parse log command options into walkopts
 
     The returned walkopts will be passed in to getrevs() or makewalker().