Nov-30-2018, 08:55 AM
(This post was last modified: Nov-30-2018, 08:55 AM by Gribouillis.)
If you come from the Java world, don't think ABCMeta plays a similar role in Python as interfaces do in Java. I would have written these classes with a base class, but without using the
abc
module. You're adding an unnecessary complexity in the code. I think python's abc is only useful for extremely general functionalities, such as in collections.abc
, otherwise it will come in your way rather than help you. Without ABCMeta, you can simply raise NotImplementedError in the base class' method. Last but not least, use python 3!