From: Vincent Fazio Date: Thu, 29 Dec 2022 18:53:46 +0000 (-0600) Subject: add overload stubs X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb4328f098be5d66e93417a1dddf0ca95735e9df;p=thirdparty%2Fsqlalchemy%2Falembic.git add overload stubs Fixes: #1146 Signed-off-by: Vincent Fazio --- diff --git a/alembic/context.pyi b/alembic/context.pyi index 9871fadd..86345c4f 100644 --- a/alembic/context.pyi +++ b/alembic/context.pyi @@ -7,7 +7,9 @@ from typing import Callable from typing import ContextManager from typing import Dict from typing import List +from typing import Literal from typing import Optional +from typing import overload from typing import TextIO from typing import Tuple from typing import TYPE_CHECKING @@ -644,8 +646,13 @@ def get_tag_argument() -> Optional[str]: """ +@overload +def get_x_argument(as_dictionary: Literal[False]) -> List[str]: ... +@overload +def get_x_argument(as_dictionary: Literal[True]) -> Dict[str, str]: ... +@overload def get_x_argument( - as_dictionary: bool = False, + as_dictionary: bool = ..., ) -> Union[List[str], Dict[str, str]]: """Return the value(s) passed for the ``-x`` argument, if any.