Thank you so much for your book, it's nothing short of amazing.
On to the issue - I am not sure if I just didn't understand correctly or if it actually is an issue:
At the end of chapter 7.19 you talk about design guidelines. The second one is about implementing a base mixin class. In the exampleNoiseMixin raises an NotImplementedError. So when I call AnnoyingLoudCyclist.__mro__ with
class AnnoyingLoudCyclist(AnnoyingMixin, LoudMixin, Cyclist):
pass
like before, I get the following output:
(<class '__main__.AnnoyingLoudCyclist'>, <class '__main__.AnnoyingMixin'>, <class '__main__.LoudMixin'>, <class '__main__.NoiseMixin'>, <class '__main__.Cyclist'>, <class 'object'>)
NoiseMixin comes before Cyclist in the MRO which means that when I initiate an instance of the class and call the noise method, I always get the NotImplementedError although the Cyclist class implemented the noise method.
Again, thanks so much for writing this book.
Thank you so much for your book, it's nothing short of amazing.
On to the issue - I am not sure if I just didn't understand correctly or if it actually is an issue:
At the end of chapter 7.19 you talk about design guidelines. The second one is about implementing a base mixin class. In the example
NoiseMixinraises anNotImplementedError. So when I callAnnoyingLoudCyclist.__mro__withclass AnnoyingLoudCyclist(AnnoyingMixin, LoudMixin, Cyclist):passlike before, I get the following output:
(<class '__main__.AnnoyingLoudCyclist'>, <class '__main__.AnnoyingMixin'>, <class '__main__.LoudMixin'>, <class '__main__.NoiseMixin'>, <class '__main__.Cyclist'>, <class 'object'>)NoiseMixin comes before Cyclist in the MRO which means that when I initiate an instance of the class and call the
noisemethod, I always get the NotImplementedError although the Cyclist class implemented thenoisemethod.Again, thanks so much for writing this book.