Skip to content

Require an argument to implement multiple mixins #483

Closed
@mitar

Description

@mitar

I have a base class an a set of mixins we are using to combine when defining new classes. The issue is that it seems currently there is no way to define that an argument should inherit from a list of base classes, and not just one:

def fun(argument: [BaseClass, CanBeSampledMixin, DescriptionMixin]) -> None:
    ...

So this would be that argument has to have all of the listed classes somewhere in its inheritance chain. In some way, it is similar to Union, maybe an Intersection? ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions