]> 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:29 +0000 (15:52 -0500)
commitceeaaecd2401d2407b60c22708f58a8ae0898d85
tree6b9616c0917a524dfe88661eb218f61d7c303dbf
parent1669ae65da251bfe7c8afb9b6a983bec81e8ac1b
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
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