]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Limit dc field logic to only fields that are definitely dc
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 21 Apr 2021 14:39:09 +0000 (10:39 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 21 Apr 2021 14:42:21 +0000 (10:42 -0400)
commited3f2c617239668d74ad3d86aeda0ca2030a5933
tree2c1d1881c6b2d0d9c74d41362960e575ec0c404a
parent368086e9fc49c7a1ca972480e0134d8e7a9f0544
Limit dc field logic to only fields that are definitely dc

Fixed regression where recent changes to support Python dataclasses had the
inadvertent effect that an ORM mapped class could not successfully override
the ``__new__()`` method.

In this case the "__new__" method comes out as staticmethod in
cls.__dict__ vs. a function in the metaclass dict_, so comparing
using identity fails.   I was hoping not to have too much
"dataclass" hardcoded, the logic here if it were generalized
to other attribute declaration systems there
would still have a flag that indicates an attribute is part of
the "special declaration system".

Fixes: #6331
Change-Id: Ia28a44fb57c668fa2fc5cd1ff38fd511f2c747e6
doc/build/changelog/unreleased_14/6331.rst [new file with mode: 0644]
lib/sqlalchemy/orm/decl_base.py
test/orm/declarative/test_basic.py