]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Forward `**kw` in `__init_subclass__()` to super
authorMichael Oliver <michael@michaeloliver.dev>
Tue, 5 Dec 2023 22:24:17 +0000 (17:24 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Dec 2023 20:52:45 +0000 (15:52 -0500)
commit2ad09db79d093ad866f48831ea8c641b79c7a464
tree85b42abc3fb0743a44ee9bfa352ddf91029b7215
parent6cc22338bf68b8997b48e28a58c280c9c25bcddf
Forward `**kw` in `__init_subclass__()` to super

Modified the ``__init_subclass__()`` method used by
:class:`_orm.MappedAsDataclass`, :class:`_orm.DeclarativeBase`` and
:class:`_orm.DeclarativeBaseNoMeta` to accept arbitrary ``**kw`` and to
propagate them to the ``super()`` call, allowing greater flexibility in
arranging custom superclasses and mixins which make use of
``__init_subclass__()`` keyword arguments.  Pull request courtesy Michael
Oliver.

Fixes: #10732
Closes: #10733
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10733
Pull-request-sha: 7fdeec1f3224f48213c9c9af5f3e7e5d0904dafa

Change-Id: I955a735d4e23502b5a6b22ac093e391b378edc87
(cherry picked from commit ceeaaecd2401d2407b60c22708f58a8ae0898d85)
doc/build/changelog/unreleased_20/10732.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/orm/decl_api.py
test/orm/declarative/test_basic.py