October 2018
Beginner to intermediate
736 pages
17h 39m
English
BaseArtisan and BaseOrder have products properties that behave the same way, to the extent that the original implementation of those properties involved essentially copying and pasting the code from one into the other. While that's probably not such a big deal in this particular case (since the hms_core class library is small, with few members, and there are only two places where that duplicate code would have to be maintained), in larger libraries, or if there was a lot of duplication of that code, it could become very problematic very quickly. Since Python allows classes to inherit from multiple parent classes, we can leverage that capability to define a new ABC—HasProducts—that will keep all ...
Read now
Unlock full access