From 0fc93b5da3459023de391f14532542f2bae61439 Mon Sep 17 00:00:00 2001 From: Yobmod Date: Mon, 5 Jul 2021 14:15:35 +0100 Subject: Rmv is_config_level() and get_args(), not worth the trouble --- git/types.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'git') 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: -- cgit v1.2.1