Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork938
Open
Description
Just happen to notice that inGitPython == 3.1.27
the static typing pipmypy fails to recognize the**kwargs
ofRemote.fetch()
inremote.py
. This happens because the kwargs argument is typed as Any, which is plausible but may be narrowed down to e.g.Union[None, Dict[str, int, bool]]
. For the correct list of possible types we'd need to check docs atgit-fetch.
Use case is the following code snippet:
deffetch_all(self,repository:git.Repo)->List[git.FetchInfo]:fetch_kwargs= {'tags':True,'force':True,'prune':True,'prune-tags':True}origin_server=repository.remotes.originorigin_server.fetch(**fetch_kwargs)# Note: mypy does not recognize kwargs because GitPython does type it as Anyfetch_info_list=origin_server.pull()returnfetch_info_list
(Code above is my custom code and not part of this project!)
Edit: Usingmypy==0.971
andmypy-extensions==0.4.3
. Not sure if mypy should ignore this at least we can help it find a potential type.