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 is failing onfrom git import Blob #1349

Closed
Assignees
Yobmod
@pbeza

Description

@pbeza

Whymypy 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 errorin 1 file (checked 1source file)$ python3 -c"import git; print(git.__version__)"3.1.23$ mypy --versionmypy 0.910$ python3 --versionPython 3.9.7

?

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

ifTYPE_CHECKING:fromgit.repoimportRepofromgitdb.baseimportOStreamfrom .treeimportTreefrom .blobimportBlobfrom .submodule.baseimportSubmodulefromgit.refs.referenceimport

and it seems thatTYPE_CHECKING is set toFalse (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

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp