ItemWidget is a mixin, which causes issues with some type checkers when it is annotated as the return type of a function.
Really what needs to happen is that those functions need to be annotated that they return an object that has multiple inheritance: Widget+ItemWidget
Apparently, the correct way to deal with this is to use Protocols that inherit both types?
How do you annotate multiple inheritance? Is there an Intersection type annotation?
This way the ItemWidget-specific functionality remains separate (no need to turn Widget back into a kitchen sink). But type checkers will correctly infer that ItemWidgets have both Widget and ItemWidgetMixin methods.
This issue is a reminder for me to implement the above for all the widget mixin types. Should be mostly just a bunch of renames.
ItemWidget is a mixin, which causes issues with some type checkers when it is annotated as the return type of a function.
Really what needs to happen is that those functions need to be annotated that they return an object that has multiple inheritance: Widget+ItemWidget
Apparently, the correct way to deal with this is to use Protocols that inherit both types?How do you annotate multiple inheritance? Is there an Intersection type annotation?
This way the ItemWidget-specific functionality remains separate (no need to turn Widget back into a kitchen sink). But type checkers will correctly infer that ItemWidgets have both Widget and ItemWidgetMixin methods.
This issue is a reminder for me to implement the above for all the widget mixin types. Should be mostly just a bunch of renames.