Skip to content

Commit c885781

Browse files
committed
improvement: teach mypy that Object.type is not always supposed to be None
1 parent 6a23335 commit c885781

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git/objects/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import gitdb.typ as dbtyp
99
import os.path as osp
10+
from typing import Optional # noqa: F401 unused import
1011

1112
from .util import get_object_type_by_name
1213

@@ -24,7 +25,7 @@ class Object(LazyMixin):
2425

2526
TYPES = (dbtyp.str_blob_type, dbtyp.str_tree_type, dbtyp.str_commit_type, dbtyp.str_tag_type)
2627
__slots__ = ("repo", "binsha", "size")
27-
type = None # to be set by subclass
28+
type = None # type: Optional[str] # to be set by subclass
2829

2930
def __init__(self, repo, binsha):
3031
"""Initialize an object by identifying it by its binary sha.

0 commit comments

Comments
 (0)