| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,7 @@ | |||
| 24 | 24 | Dict, | |
| 25 | 25 | IO, | |
| 26 | 26 | Optional, | |
| 27 | + Tuple, | ||
| 27 | 28 | Type, | |
| 28 | 29 | Union, | |
| 29 | 30 | overload, | |
@@ -92,16 +93,16 @@ def win_encode(s: Optional[AnyStr]) -> Optional[bytes]: | |||
| 92 | 93 | return None | |
| 93 | 94 | ||
| 94 | 95 | ||
| 95 | - def with_metaclass(meta: Type[Any], *bases: Any) -> 'metaclass': # type: ignore ## mypy cannot understand dynamic class creation | ||
| 96 | + def with_metaclass(meta: Type[Any], *bases: Any) -> TBD: # type: ignore ## mypy cannot understand dynamic class creation | ||
| 96 | 97 | """copied from https://github.com/Byron/bcore/blob/master/src/python/butility/future.py#L15""" | |
| 97 | 98 | ||
| 98 | 99 | class metaclass(meta): # type: ignore | |
| 99 | 100 | __call__ = type.__call__ | |
| 100 | 101 | __init__ = type.__init__ # type: ignore | |
| 101 | 102 | ||
| 102 | - def __new__(cls, name: str, nbases: Optional[int], d: Dict[str, Any]) -> TBD: | ||
| 103 | + def __new__(cls, name: str, nbases: Optional[Tuple[int, ...]], d: Dict[str, Any]) -> TBD: | ||
| 103 | 104 | if nbases is None: | |
| 104 | 105 | return type.__new__(cls, name, (), d) | |
| 105 | 106 | return meta(name, bases, d) | |
| 106 | 107 | ||
| 107 | - return metaclass(meta.__name__ + 'Helper', None, {}) | ||
| 108 | + return metaclass(meta.__name__ + 'Helper', None, {}) # type: ignore | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,13 +22,23 @@ | |||
| 22 | 22 | with_metaclass, | |
| 23 | 23 | is_win, | |
| 24 | 24 | ) | |
| 25 | - from git.compat.typing import Literal | ||
| 25 | + | ||
| 26 | 26 | from git.util import LockFile | |
| 27 | 27 | ||
| 28 | 28 | import os.path as osp | |
| 29 | 29 | ||
| 30 | 30 | import configparser as cp | |
| 31 | 31 | ||
| 32 | + # typing------------------------------------------------------- | ||
| 33 | + | ||
| 34 | + from typing import TYPE_CHECKING, Tuple | ||
| 35 | + | ||
| 36 | + from git.types import Literal | ||
| 37 | + | ||
| 38 | + if TYPE_CHECKING: | ||
| 39 | + pass | ||
| 40 | + | ||
| 41 | + # ------------------------------------------------------------- | ||
| 32 | 42 | ||
| 33 | 43 | __all__ = ('GitConfigParser', 'SectionConstraint') | |
| 34 | 44 | ||
@@ -38,7 +48,8 @@ | |||
| 38 | 48 | ||
| 39 | 49 | # invariants | |
| 40 | 50 | # represents the configuration level of a configuration file | |
| 41 | - CONFIG_LEVELS = ("system", "user", "global", "repository") | ||
| 51 | + CONFIG_LEVELS = ("system", "user", "global", "repository" | ||
| 52 | + ) # type: Tuple[Literal['system'], Literal['user'], Literal['global'], Literal['repository']] | ||
| 42 | 53 | ||
| 43 | 54 | # Section pattern to detect conditional includes. | |
| 44 | 55 | # https://git-scm.com/docs/git-config#_conditional_includes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,8 +16,7 @@ | |||
| 16 | 16 | # typing ------------------------------------------------------------------ | |
| 17 | 17 | ||
| 18 | 18 | from typing import Any, Iterator, List, Match, Optional, Tuple, Type, Union, TYPE_CHECKING | |
| 19 | - from git.compat.typing import Final, Literal | ||
| 20 | - from git.types import TBD | ||
| 19 | + from git.types import TBD, Final, Literal | ||
| 21 | 20 | ||
| 22 | 21 | if TYPE_CHECKING: | |
| 23 | 22 | from .objects.tree import Tree | |
| Back | FazBrowse Home | New Git URL |
0 commit comments