Remove or move several TypeAlias declarations (#8444)

This commit is contained in:
Alex Waygood
2022-07-30 15:28:52 +01:00
committed by GitHub
parent 275fc28733
commit fdeb216547
15 changed files with 46 additions and 55 deletions

View File

@@ -7,7 +7,6 @@ _Expression: TypeAlias = Any # mypy.nodes.Expression
_RefExpr: TypeAlias = Any # mypy.nodes.RefExpr
_TypeInfo: TypeAlias = Any # mypy.nodes.TypeInfo
_Var: TypeAlias = Any # mypy.nodes.Var
_StrExpr: TypeAlias = Any # mypy.nodes.StrExpr
_SemanticAnalyzerPluginInterface: TypeAlias = Any # mypy.plugin.SemanticAnalyzerPluginInterface
_ProperType: TypeAlias = Any # mypy.types.ProperType

View File

@@ -1,11 +1,8 @@
from typing import Any
from typing_extensions import Literal, TypeAlias
from ..sql.base import CompileState, Options
from ..sql.dml import DeleteDMLState, UpdateDMLState
_SynchronizeSessionArgument: TypeAlias = Literal[False, "evaluate", "fetch"]
def save_obj(base_mapper, states, uowtransaction, single: bool = ...) -> None: ...
def post_update(base_mapper, states, uowtransaction, post_update_cols) -> None: ...
def delete_obj(base_mapper, states, uowtransaction) -> None: ...

View File

@@ -1,18 +1,19 @@
from _typeshed import Self
from collections.abc import Iterator
from typing import Any, Generic, TypeVar
from typing_extensions import Literal, TypeAlias
from ..sql.annotation import SupportsCloneAnnotations
from ..sql.base import Executable
from ..sql.selectable import GroupedElement, HasHints, HasPrefixes, HasSuffixes, SelectBase, _SelectFromElements
from . import interfaces
from .context import QueryContext as QueryContext
from .persistence import _SynchronizeSessionArgument
from .util import aliased as aliased
__all__ = ["Query", "QueryContext", "aliased"]
_T = TypeVar("_T")
_SynchronizeSessionArgument: TypeAlias = Literal[False, "evaluate", "fetch"]
class Query(_SelectFromElements, SupportsCloneAnnotations, HasPrefixes, HasSuffixes, HasHints, Executable, Generic[_T]):
logger: Any