]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add type annotations to indexable extension code
authorDenis Laxalde <denis@laxalde.org>
Fri, 3 Oct 2025 19:10:08 +0000 (15:10 -0400)
committerFederico Caselli <cfederico87@gmail.com>
Sat, 4 Oct 2025 19:10:38 +0000 (21:10 +0200)
commitb2aa0e2575d3e779a9fc757b04896e9b61045aa8
treeb8139682d6e10f28d8340e57fff49fcb548898d4
parente833474db064df32a7c02e809893e71ac4df4996
Add type annotations to indexable extension code

A typing test case (plain_files/ext/indexable.py) is also added.

In order to make the methods of index_property conform with type
definitions of `fget`, `fset` and `fdel` arguments of hybrid_property,
we need to make the signature of protocols
(e.g. `_HybridGetterType`) `__call__`) method positional only.

Related to #6810.

Closes: #12763
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/12763
Pull-request-sha: 896b9642629fb212a71e68ed3f08705d08407dbf

Change-Id: I42980ccf20ff9c992ebd616f38545e06ede57d36
lib/sqlalchemy/ext/hybrid.py
lib/sqlalchemy/ext/indexable.py
test/typing/plain_files/ext/indexable.py [new file with mode: 0644]