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/util.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/util.py')
| -rw-r--r-- | lib/sqlalchemy/sql/util.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py index 5114a2431..cdce49f7b 100644 --- a/lib/sqlalchemy/sql/util.py +++ b/lib/sqlalchemy/sql/util.py @@ -15,6 +15,7 @@ from itertools import chain import typing from typing import Any from typing import cast +from typing import Iterator from typing import Optional from . import coercions @@ -33,6 +34,7 @@ from .elements import _find_columns # noqa from .elements import _label_reference from .elements import _textual_label_reference from .elements import BindParameter +from .elements import ClauseElement # noqa from .elements import ColumnClause from .elements import ColumnElement from .elements import Grouping @@ -51,6 +53,7 @@ from .. import exc from .. import util if typing.TYPE_CHECKING: + from .roles import FromClauseRole from ..engine.interfaces import _AnyExecuteParams from ..engine.interfaces import _AnyMultiExecuteParams from ..engine.interfaces import _AnySingleExecuteParams @@ -404,7 +407,7 @@ def clause_is_present(clause, search): return False -def tables_from_leftmost(clause): +def tables_from_leftmost(clause: FromClauseRole) -> Iterator[FromClause]: if isinstance(clause, Join): for t in tables_from_leftmost(clause.left): yield t |
