Skip to content

Commit 0ba06e9

Browse files
committed
Add git.repo.__all__ and make submodules explicit
- No need to import Repo "as Repo". Some tools only recognize this to give the name conceptually public status when it appears in type stub files (.pyi files), and listing it in the newly created __all__ is sufficient to let humans and all tools know it has that status. - As very recently done in git.refs, this explicitly imports the submodules, so it is clear they are available and don't have to be explicitly imported. (Fundamental to the way they are used is that they will end up being imported in order to import Repo.) However, also as in git.refs, it may be that the problems this could cause in some inherently flawed but plausible uses are too greater for it to be justified. So this may be revisited.
1 parent b32ef65 commit 0ba06e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: git/repo/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@
33

44
"""Initialize the repo package."""
55

6-
from .base import Repo as Repo # noqa: F401
6+
__all__ = ["base", "fun", "Repo"]
7+
8+
from . import base, fun
9+
from .base import Repo

0 commit comments

Comments
 (0)