From fb4328f098be5d66e93417a1dddf0ca95735e9df Mon Sep 17 00:00:00 2001 From: Vincent Fazio Date: Thu, 29 Dec 2022 12:53:46 -0600 Subject: [PATCH] add overload stubs Fixes: #1146 Signed-off-by: Vincent Fazio --- alembic/context.pyi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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. -- 2.47.3