Patchwork D10167: typing: switch an argument type to the generic form

login
register
mail settings
Submitter phabricator
Date March 12, 2021, 6:08 p.m.
Message ID <differential-rev-PHID-DREV-qldmfmtwbsd55hhxjroj-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48483/
State Superseded
Headers show

Comments

phabricator - March 12, 2021, 6:08 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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, ...)

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D10167

AFFECTED FILES
  mercurial/logcmdutil.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -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().