Skip to content

generic mixin type #7

@obriencj

Description

@obriencj

I'd like to figure out how to enable a generic inheritance that does the same thing proxytype does. Even better if we could make it safe for runtime.

class SomeClass(VirtualMixin[ClassA, ClassB, ClassC]):
    ...

Would be similar to a proxytype definition to mix the definitions of ClassA, ClassB, and ClassC into the SomeClass definition.

In addition, I'd really love dynamic mixin casting,

class SomeClass(VirtualMixin):
    ...

val: SomeClass[ClassA, ClassC] = get_some_class()

This would be useful for situations where the union of mixins is dynamic locally, but somewhat fixed locally. For example, you're connecting to a koji instance with a few known plugins enabled which add new hub API calls. Those plugins could be defined in separate protocol definitions.

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