diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-25 17:08:48 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-03-30 14:04:52 -0400 |
commit | 4e754a8914a1c2c16c97bdf363d2e24bfa823730 (patch) | |
tree | db723242b4e4c0d4c7f15c167857dd79fdfa6ccb /lib/sqlalchemy/sql/coercions.py | |
parent | dba480ebaf89c0b5ea787661583de9da3928920f (diff) | |
download | sqlalchemy-4e754a8914a1c2c16c97bdf363d2e24bfa823730.tar.gz |
pep-484: the pep-484ening, SQL part three
hitting DML which is causing us to open up the
ColumnCollection structure a bit, as we do put anonymous
column expressions with None here. However, we still want
Table /TableClause to have named column collections that
don't return None, so parametrize the "key" in this
collection also.
* rename some "immutable" elements to "readonly". we change
the contents of immutablecolumncollection underneath, so it's
not "immutable"
Change-Id: I2593995a4e5c6eae874bed5bf76117198be8ae97
Diffstat (limited to 'lib/sqlalchemy/sql/coercions.py')
-rw-r--r-- | lib/sqlalchemy/sql/coercions.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/coercions.py b/lib/sqlalchemy/sql/coercions.py index 35cd33a18..ccc8fba8d 100644 --- a/lib/sqlalchemy/sql/coercions.py +++ b/lib/sqlalchemy/sql/coercions.py @@ -46,6 +46,7 @@ if typing.TYPE_CHECKING: from . import schema from . import selectable from . import traversals + from ._typing import _ColumnsClauseArgument from .elements import ClauseElement from .elements import ColumnClause from .elements import ColumnElement @@ -166,6 +167,32 @@ def expect( @overload def expect( + role: Type[roles.DMLTableRole], + element: Any, + *, + apply_propagate_attrs: Optional[ClauseElement] = None, + argname: Optional[str] = None, + post_inspect: bool = False, + **kw: Any, +) -> roles.DMLTableRole: + ... + + +@overload +def expect( + role: Type[roles.ColumnsClauseRole], + element: Any, + *, + apply_propagate_attrs: Optional[ClauseElement] = None, + argname: Optional[str] = None, + post_inspect: bool = False, + **kw: Any, +) -> roles.ColumnsClauseRole: + ... + + +@overload +def expect( role: Type[_SR], element: Any, *, |