Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mypy error due to missing typing of **kwargs in Remote.fetch() #1472

Open
@maunzCache

Description

@maunzCache

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp