You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry for the rather vague title, but I can't put it more precise. Find below a code example, I tried to keep it relevant for my use case. Note that, while the code shown is python3, the actual usage is in python2. Both versions behave identical though.
classWindow:
""" Base class for all elements that act like windows, can be shown and hidden. """defshow(self, **kwargs):
# this is supposed to be implemented by subclassesraiseNotImplementedErrorclassSpecialWidget:
""" Widget that shows things, like a table that is updated. """defshow(self):
# setup gui elementspassdefupdate_things(self):
passclassFooWindow(SpecialWidget, Window): # <-- E: Definition of "show" in base class "SpecialWidget" is incompatible with definition in base class "Window"""" A window that uses the GUI setup of SpecialWidget. """defupdate_things(self):
pass
I fully understand the error, however, I'm at a loss on what to do about it. Obviously I could add **kwargs to Specialwidget.show, that gets rid of the error. But I don't really want to do that.
I tried to add my own show implementation in FooWindow:
defshow(self):
SpecialWidget.show(self)
But that doesn't work. I also tried to have mypy ignore the definitions:
Sorry for the rather vague title, but I can't put it more precise. Find below a code example, I tried to keep it relevant for my use case. Note that, while the code shown is python3, the actual usage is in python2. Both versions behave identical though.
I fully understand the error, however, I'm at a loss on what to do about it. Obviously I could add
**kwargs
toSpecialwidget.show
, that gets rid of the error. But I don't really want to do that.I tried to add my own
show
implementation inFooWindow
:But that doesn't work. I also tried to have mypy ignore the definitions:
But that doesn't seem to be working either.
I'd appreciate any pointers, be it help with ignoring the error, fixing it or refactoring the code to avoid this issue.
The text was updated successfully, but these errors were encountered: