← 返回首页
mypy is failing on `from git import Blob` · Issue #1349 · gitpython-developers/GitPython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

mypy is failing on from git import Blob #1349

New issue
New issue

Description

Why mypy is failing when running this code:

$ cat /tmp/test.py from git import Blob $ mypy /tmp/test.py /tmp/test.py:1: error: Module "git" has no attribute "Blob" Found 1 error in 1 file (checked 1 source file) $ python3 -c "import git; print(git.__version__)" 3.1.23 $ mypy --version mypy 0.910 $ python3 --version Python 3.9.7

?

I can see that there is a conditional import in git/objects/base.py:

if TYPE_CHECKING: from git.repo import Repo from gitdb.base import OStream from .tree import Tree from .blob import Blob from .submodule.base import Submodule from git.refs.reference import

and it seems that TYPE_CHECKING is set to False (I guess so based on the above error). Do you know why is that? How to workaround the problem?

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Footer

    © 2026 GitHub, Inc.