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
refactor: make XModuleMixin extend XBlockMixin, not XBlock
In order to get typechecking to pass in XBlock, we needed to make
ScorableXBlockMixin a subclass of XBlockMixin. This change, while
sensible, creates an ambiguous method resolution order in the
ProblemBlock, stemming from the fact that XModuleMixin inherits directly
from XBlock.
The fix is to simply make XModuleMixin inherit from XBlockMixin
instead-- this makes sense because XModuleMixin is a helper mixin, not
an XBlock itself. We then must add XBlock as an explicit subclass to all
blocks which inherit from XBlock. This should have no functional impact,
but *should* help us add type hints to the xmodule/ folder in the
future.
Using ProblemBlock as an example... before (XBlock < 6.0.0) we have:
ProblemBlock <- ScorableXBlockMixin
<- XModuleMixin <- XBlock <- Blocklike
after (XBlock >= 6.0.0) we have:
ProblemBlock <- ScorableXBlockMixin <- XBlockMixin <- Blocklike
<- XModuleMixin <- XBlockMixin <- Blocklike
<- XBlock <- Blocklike
0 commit comments