]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add __class_getitem__ to the declarative Base class
authorKai Mueller <15907922+kasium@users.noreply.github.com>
Wed, 1 Dec 2021 15:58:40 +0000 (10:58 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 1 Dec 2021 18:23:16 +0000 (13:23 -0500)
commit3d4e64b8ef666ea4760c8234ba475b12739660ce
tree06445afaf9d58a63338465ac9ae6dabddcbc94ab
parent703ff387c13f083ed0982071963155d679c862ab
Add __class_getitem__ to the declarative Base class

Fixed issue where the :func:`_orm.as_declarative` decorator and similar
functions used to generate the declarative base class would not copy the
``__class_getitem__()`` method from a given superclass, which prevented the
use of pep-484 generics in conjunction with the ``Base`` class. Pull
request courtesy Kai Mueller.

Fixes: #7368
Closes: #7381
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7381
Pull-request-sha: 7db7fd869a6bb617f767fad5b71ddf7cb5f14ff5

Change-Id: I495718c3082ad6dd2c83fdbf6feba7c529e351cb
(cherry picked from commit 20fe2a3dc2597b04338e8907883c6f4ea72518c8)
doc/build/changelog/unreleased_14/7368.rst [new file with mode: 0644]
lib/sqlalchemy/orm/decl_api.py
test/orm/declarative/test_typing_py3k.py [new file with mode: 0644]