I have a specific problem closely related to PyCharm (Community 3.1.1). The following simple example illustrates this. I will use the screenshot of PyCharm rather than type the code, for reasons that will be clear shortly.
As you can see, the call to self.say_hello()
is highlighted in yellow by PyCharm, and presumably this is because say_hello()
is not implemented in the Base
class. The fact that say_hello()
is not implemented in the base class is intentional on my part, because I want a kind of "abstract" effect, so that an instance of Base
cannot call say_hello()
(and therefore shouldn't call hello()
), but that an instance of Child
can call hello()
(implemented in the Base
class). How do I get this "abstract" effect without PyCharm complaining?
As I learned from here, I could use the abc
module. But that, to me, would be rather cumbersome and somewhat not pythonic. What are your recommendations?