]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
call super().__init_subclass__(); support GenericAlias
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 18 Oct 2022 17:25:06 +0000 (13:25 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 19 Oct 2022 12:00:35 +0000 (08:00 -0400)
commitde7007e7cc6231b067df71ca79efee75f3317eae
tree2fb45141c586ee84a6f1c7f6106439350e5d5753
parent974b1bd0fc40e11fc2886b5a9fc333feeeebf546
call super().__init_subclass__(); support GenericAlias

Improved the :class:`.DeclarativeBase` class so that when combined with
other mixins like :class:`.MappedAsDataclass`, the order of the classes may
be in either order.

Added support for mapped classes that are also ``Generic`` subclasses,
to be specified as a ``GenericAlias`` object (e.g. ``MyClass[str]``)
within statements and calls to :func:`_sa.inspect`.

Fixes: #8665
Change-Id: I03063a28b0438a44b9e028fd9d45e8ce08bd18c4
doc/build/changelog/unreleased_20/8665.rst [new file with mode: 0644]
lib/sqlalchemy/orm/decl_api.py
lib/sqlalchemy/orm/util.py
test/orm/declarative/test_dc_transforms.py
test/orm/declarative/test_typed_mapping.py