Skip to content

Restore __setattr__ when subclassing and we didn't write a new __setattr__ #661

@hynek

Description

@hynek

Currently if you do this:

@attr.s(frozen=True)
class A:
    a = attr.ib()

@attr.s
class B(A):
    b = attr.ib()

B is frozen too, because we don't write a new __setattr__ to overwrite the old one. Once #660 is merged, this will become an even bigger problem.

We have to restore __setattr__ to object.__setattr__ if we don't have a reason to overwrite the existing one ourselves.

auto_detect=True should be considered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions