I am using a mixin to separate a range of functionality to a different class. This Mixin is only supposed to be mixable with the only child class:
class Mixin:
def complex_operation(self):
return self.foo.capitalize()
class A(Mixin):
def __init__(self):
self.foo = 'foo'
in my method Mixin.complex_operation
PyCharm gives warning 'Unresolved Attribute Reference foo'.
Am I using the mixin pattern correctly? Is there a better way? (I would like to have type hints and autocompletion in my mixins, and I would like to have multiple mixins.)