]> 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>
Mon, 16 Mar 2026 19:47:06 +0000 (15:47 -0400)
commit0a185a3bb6347719ffab60012db8fbbc23eb29e4
treeecb3fd44fcbc37df18b952fd1242c7d24e87ef23
parente7c45bae55e771044b30df9cdfce2c21b5177eac
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
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