B
B
Boris192018-08-30 11:04:22
Python
Boris19, 2018-08-30 11:04:22

Specifying an abstract class method?

Does it make sense to use the @abstractmethod decorator on a base class if using raise NotImplementedError essentially makes that method abstract anyway?
Although it is possible that this is just PyCharm being too smart and based on raise it defines this method as abstract

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kitaev, 2018-08-30
@Boris19

Yes, this paycharm is smart. Runtime without the @abstractmethod decorator will not tell you that something is wrong with you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question