]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
ensure function classes are not shadowed
authorFederico Caselli <cfederico87@gmail.com>
Thu, 12 Mar 2026 22:34:27 +0000 (23:34 +0100)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 17 Mar 2026 18:19:12 +0000 (14:19 -0400)
commit9873053ec311b150ba7cfb20913e6ea03af87c1f
treeca7d7d78c46a2be1c17af2b3ece491f8be590f33
parent453f7ac6a3e4dea0904abefae6b33c31d44c4df3
ensure function classes are not shadowed

Ensure the _FunctionGenerator method do not shadow the function class
of the same name

Fixed a typing issue where the typed members of :data:`.func` would return
the appropriate class of the same name, however this creates an issue for
typecheckers such as Zuban and pyrefly that assume :pep:`749` style
typechecking even if the file states that it's a :pep:`563` file; they see
the returned name as indicating the method object and not the class object.
These typecheckers are actually following along with an upcoming test
harness that insists on :pep:`749` style name resolution for this case
unconditionally.  Since :pep:`749` is the way of the future regardless,
differently-named type aliases have been added for these return types.

Fixes: #13167
Change-Id: If58a3858001c78ab21b2ed343205dfd9ce868576
(cherry picked from commit 0a185a3bb6347719ffab60012db8fbbc23eb29e4)
doc/build/changelog/unreleased_20/13167.rst [new file with mode: 0644]
lib/sqlalchemy/sql/functions.py
test/typing/plain_files/sql/functions.py
tools/generate_sql_functions.py