diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2023-03-08 12:35:27 -0500 |
---|---|---|
committer | mike bayer <mike_mp@zzzcomputing.com> | 2023-03-08 21:33:12 +0000 |
commit | 1504aa9f9f95964ee73030a76941b8169e04d5bc (patch) | |
tree | 2e0dd37bd29356c9a5e03468d384d31a56275521 /lib/sqlalchemy/sql | |
parent | bcbb4007bbfa5102d7e53fea8aac50e528d4d1f2 (diff) | |
download | sqlalchemy-1504aa9f9f95964ee73030a76941b8169e04d5bc.tar.gz |
Use independent TypeVar for ColumnElement.cast
Fixed typing issue where :meth:`.ColumnElement.cast` did not allow a
:class:`.TypeEngine` argument independent of the type of the
:class:`.ColumnElement` itself, which is the purpose of
:meth:`.ColumnElement.cast`.
Fixes: #9451
Change-Id: I68119c6a9e8bf896715eea79be2b4f36b1c141de
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r-- | lib/sqlalchemy/sql/elements.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index a416b6ac0..ef4587e18 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -1635,7 +1635,7 @@ class ColumnElement( co._is_clone_of = selectable._is_clone_of.columns.get(key) return key, co - def cast(self, type_: _TypeEngineArgument[_T]) -> Cast[_T]: + def cast(self, type_: _TypeEngineArgument[_OPT]) -> Cast[_OPT]: """Produce a type cast, i.e. ``CAST(<expression> AS <type>)``. This is a shortcut to the :func:`_expression.cast` function. |