From 4e754a8914a1c2c16c97bdf363d2e24bfa823730 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 25 Mar 2022 17:08:48 -0400 Subject: 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 --- lib/sqlalchemy/sql/functions.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/functions.py') diff --git a/lib/sqlalchemy/sql/functions.py b/lib/sqlalchemy/sql/functions.py index 9e801a99f..3bca8b502 100644 --- a/lib/sqlalchemy/sql/functions.py +++ b/lib/sqlalchemy/sql/functions.py @@ -298,7 +298,7 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative): return self.alias(name=name).column - @property + @util.ro_non_memoized_property def columns(self): r"""The set of columns exported by this :class:`.FunctionElement`. @@ -320,6 +320,11 @@ class FunctionElement(Executable, ColumnElement[_T], FromClause, Generative): SQL function expressions. """ # noqa E501 + return self.c + + @util.ro_memoized_property + def c(self): + """synonym for :attr:`.FunctionElement.columns`.""" return ColumnCollection( columns=[(col.key, col) for col in self._all_selected_columns] -- cgit v1.2.1