Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic mixin type #7

Open
obriencj opened this issue May 27, 2024 · 0 comments
Open

generic mixin type #7

obriencj opened this issue May 27, 2024 · 0 comments

Comments

@obriencj
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant