]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix type hint of `key` on `Visitable.__class_getitem__()`
authorJordan Macdonald <macdjord@gmail.com>
Wed, 16 Aug 2023 15:00:59 +0000 (11:00 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 22 Aug 2023 02:29:03 +0000 (22:29 -0400)
commitdf126fe0d1799367572af6410b76850eebcd1100
tree112e7a09981cb3dfb30753809349cd8e40798b37
parente5a81c980b5c07f7d980b90149c6b18ea16f6f4b
Fix type hint of `key` on `Visitable.__class_getitem__()`

Fixed the type annotation for ``__class_getitem__()`` as applied to the
``Visitable`` class at the base of expression constructs to accept ``Any``
for a key, rather than ``str``, which helps with some IDEs such as PyCharm
when attempting to write typing annotations for SQL constructs which
include generic selectors.  Pull request courtesy Jordan Macdonald.

Fixes: #9878
Closes: #9881
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9881
Pull-request-sha: 5aefaaf1065d1f946137a8b2f5be0767856cf9b0

Change-Id: I956e6d41142c50d870a142c3e99567a7ed2f7114
doc/build/changelog/unreleased_20/9878.rst [new file with mode: 0644]
lib/sqlalchemy/orm/decl_api.py
lib/sqlalchemy/sql/visitors.py