Animal.feed() is documented as abstract but is not enforced as an abstract method
Describe the bug The Animal.feed() method is documented as an abstract method that should be implemented by subclasses:
def feed(self):
"""Abstract method to be implemented by subclasses."""
However, the method is not decorated with @abstractmethod, and the Animal class does not inherit from ABC.
As a result, Python does not enforce the implementation of feed() in subclasses. A subclass that does not override this method can be instantiated without raising an error, potentially resulting in animals that do not perform any feeding behavior.
Expected behavior The implementation and documentation should be consistent. Either:
- Make Animal an actual abstract base class using ABC and
@abstractmethodso subclasses must implement feed(), or - Update the docstring to clarify that feed() is intended to be overridden but is not enforced as abstract.
Actual behavior The method is described as abstract, but Python treats it as an ordinary method with an empty implementation.
Hi @quaquel, could you please take a look at this and share your feedback?
Hi @sangitabera, thanks for reporting this. Were you planning to fix it yourself? If it's free, I'd like to take it — happy to pick another issue if you were already on it.
Hii @Nishant-neural , thanks for asking. Currently I am working on this issue and just waiting for the feedback then I will open my PR.
hello @sangitabera ,Thanks for letting me know — all yours, I'll pick another issue, good luck!!