As a minimal case I have a class Example
that works like in abstract capacity for a range of other classes.
class Example(object):
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
class Test(Example):
def __init__(self, foo='bar'):
super(Test, self).__init__(foo=foo)
In the real case, Example
does more things.
Is there a way to on Test
inform PyCharm that Test
will have one field Test.foo
and even better, let it know that foo
is expected to be a string?
To be clear, consider delegating the setting of fields from Example
to Test
not possible.
The closest I've gotten is the @ivar
of Epydoc, but I can't get it to work