summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-05 14:15:35 +0100
committerYobmod <yobmod@gmail.com>2021-07-05 14:15:35 +0100
commit0fc93b5da3459023de391f14532542f2bae61439 (patch)
tree94c02c3244f371fc61eabd4e9be2c2a4ba44c674
parent0939e38fd8fdb0567762b8a68190f7f762cf9756 (diff)
downloadgitpython-0fc93b5da3459023de391f14532542f2bae61439.tar.gz
Rmv is_config_level() and get_args(), not worth the trouble
-rw-r--r--git/types.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/git/types.py b/git/types.py
index 69286191..9de4449b 100644
--- a/git/types.py
+++ b/git/types.py
@@ -9,7 +9,7 @@ from typing import (Callable, Dict, NoReturn, Tuple, Union, Any, Iterator,
if sys.version_info[:2] >= (3, 8):
- from typing import Final, Literal, SupportsIndex, TypedDict, Protocol, get_args # noqa: F401
+ from typing import Final, Literal, SupportsIndex, TypedDict, Protocol # noqa: F401
else:
from typing_extensions import Final, Literal, SupportsIndex, TypedDict, Protocol # noqa: F401
@@ -46,15 +46,8 @@ class ConfigLevels_NT(NamedTuple):
repository: Literal['repository']
-ConfigLevels_Tup = Tuple[Lit_config_levels, Lit_config_levels, Lit_config_levels, Lit_config_levels]
# Typing this as specific literals breaks for mypy
-
-
-def is_config_level(inp: str) -> TypeGuard[Lit_config_levels]:
- try:
- return inp in get_args(Lit_config_levels)
- except NameError: # get_args added in py 3.8
- return True
+ConfigLevels_Tup = Tuple[Lit_config_levels, Lit_config_levels, Lit_config_levels, Lit_config_levels]
def assert_never(inp: NoReturn, exc: Union[Exception, None] = None) -> NoReturn: