Skip to content

Commit 012d710

Browse files
committed
Move our PathLike below even TYPE_CHECKING imports
The benefits are that putting imports before newly introduced names (other than names like __all__) is recommended by PEP-8, and that git.types.PathLike is not equivalent to os.PathLike and introducing it after all imports may help avoid obscuring this.
1 parent 2e02b09 commit 012d710

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: git/types.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
# else:
3939
# from typing_extensions import TypeGuard # noqa: F401
4040

41-
PathLike = Union[str, "os.PathLike[str]"]
42-
"""A :class:`str` (Unicode) based file or directory path."""
43-
4441
if TYPE_CHECKING:
4542
from git.repo import Repo
4643
from git.objects import Commit, Tree, TagObject, Blob
4744

45+
PathLike = Union[str, "os.PathLike[str]"]
46+
"""A :class:`str` (Unicode) based file or directory path."""
47+
4848
TBD = Any
4949
"""Alias of :class:`~typing.Any`, when a type hint is meant to become more specific."""
5050

0 commit comments

Comments
 (0)