Skip to content

Multiple inheritance error when using slots #667

@jacobg

Description

@jacobg

The following classes definitions causes an error:

    @attr.s(auto_attribs=True, frozen=True, slots=True, collect_by_mro=True)
    class Foo:
        foo: str

    @attr.s(auto_attribs=True, frozen=True, slots=True, collect_by_mro=True)
    class Bar:
        bar: str

    @attr.s(auto_attribs=True, frozen=True, slots=True, collect_by_mro=True)
    class Baz(Foo, Bar):
        baz: str
>       class Baz(Foo, Bar):
E       TypeError: multiple bases have instance lay-out conflict

Note that this error occurs on master with a commit that seems to purport to fix this problem:
#635

Removing the slots decorator kwargs resolves the error.

Is there a workaround that supports slots?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions