As the documentation states [docs],

In user defined base classes, abstract methods should raise this exception when they require derived classes to override the method, or while the class is being developed to indicate that the real implementation still needs to be added.

Note that although the main stated use case this error is the indication of abstract methods that should be implemented on inherited classes, you can use it anyhow you'd like, like for indication of a TODO marker.

Answer from Uriel on Stack Overflow
🌐
GitHub
github.com › python › cpython › issues › 100400
You don't need to raise NotImplementedError for abstract methods · Issue #100400 · python/cpython
December 21, 2022 - If "abstract base classes" are meant to mean ABCs from the standard library, this is unnecessary as the ABC metaclass will prohibit instantiation of any derived class that doesn't implement an abstract method. Indeed, adding a raise would be dead code that would flaunt, say, coverage metrics.
Author   Xophmeister
🌐
Python.org
discuss.python.org › python help
AbstractMethods and NotImplementedError - Python Help - Discussions on Python.org
December 22, 2022 - Are there any experts on the use of ABCs and abstractmethod who could weigh in on a documentation issue please? The documentation for the exception says that abstract methods should raise NotImplementedError. Obviously this is not mandatory. Abstract methods can have default implementations.
🌐
Reddit
reddit.com › r/learnpython › why typeerror instead of notimplementederror?
r/learnpython on Reddit: Why TypeError instead of NotImplementedError?
December 1, 2023 -

When I run the following code it it reports TypeError: Can't instantiate abstract class Dog with abstract method speak:

from abc import ABC, abstractmethod


class Animal(ABC):
    @abstractmethod
    def speak(self):
        raise NotImplementedError    
        
        
        
class Dog(Animal):
    def walk(self):
        print('dog walks instead of speaks')


dog = Dog()

I understand exactly why - I haven't provided an implementation of speak() within Dog, but I thought that was the whole point of the raise NotImplementedError line? So what actually would trigger the NotImplementedError?

🌐
Real Python
realpython.com › ref › builtin-exceptions › notimplementederror
NotImplementedError | Python’s Built-in Exceptions – Real Python
Indicating that a method in a base class needs to be implemented in a subclass · Serving as a placeholder for future code development · Alerting developers to incomplete sections of code during development ... >>> class Animal: ... def speak(self): ... raise NotImplementedError( ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-avoid-notimplementederror-in-python
How To Avoid Notimplementederror In Python? - GeeksforGeeks
July 23, 2025 - Below are some of the reason due ... concrete implementation in its subclasses. If the subclass fails to implement the abstract method, a NotImplementedError is raised....
🌐
DeepSource
deepsource.com › directory › python › issues › PTC-W0053
Abstract method does not raise `NotImplementedError` (PTC-W0053) ・ Python
import abc class Vehicle: __metaclass__ = abc.ABCMeta @abc.abstractmethod def method_to_implement(self, input): raise NotImplementedError
Find elsewhere
🌐
Python.org
discuss.python.org › typing
Calling abstract methods - Typing - Discussions on Python.org
January 6, 2024 - PEP 544 indicates that a type checker should generate an error if a class that explicitly derives from the protocol attempts to call a method through super() if that method is unimplemented in the protocol. class Proto(Protocol): def method(self) ...
🌐
JetBrains
youtrack.jetbrains.com › issue › PY-38680 › Dont-treat-classes-raising-NotImplementedError-as-abstract
Don't treat classes raising NotImplementedError as abstract
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
TestMu AI Community
community.testmuai.com › ask a question
When and why to use raise NotImplementedError in Python? - TestMu AI Community
October 31, 2024 - When should you use raise NotImplementedError in Python? Is it primarily to remind yourself or your team to implement the methods in a class properly? I’m struggling to fully understand the use of an abstract class with this pattern: class RectangularRoom(object): def __init__(self, width, height): raise NotImplementedError def cleanTileAtPosition(self, pos): raise NotImplementedError def isTileCleaned(self, m, n): raise NotImplementedError Could you clar...
🌐
GitHub
github.com › nvaccess › nvda › issues › 8294
Use pythonic abstract classes instead of just raising NotImplementedError for unimplemented methods · Issue #8294 · nvaccess/nvda
May 17, 2018 - Steps to reproduce: Quick and dirty example on the python console: import textInfos textInfos.TextInfo(nav, "all") Expected behavior: textInfos.TextInfo can't be initialized as it is too abstract. An error like this is raised: TypeError:...
Published   May 17, 2018
Author   LeonarddeR
🌐
Pylint
pylint.readthedocs.io › en › latest › user_guide › messages › warning › abstract-method.html
abstract-method / W0223 - Pylint 4.1.0-dev0 documentation
import abc class WildAnimal: @abc.abstractmethod def make_sound(self): pass class Panther(WildAnimal): # [abstract-method] pass ... import abc class WildAnimal: @abc.abstractmethod def make_sound(self): pass class Panther(WildAnimal): def make_sound(self): print("MEEEOW") ... class Pet: def make_sound(self): raise NotImplementedError class Cat(Pet): def make_sound(self): print("Meeeow")
🌐
Flake8rules
flake8rules.com › rules › F901.html
raise NotImplemented should be raise NotImplementedError (F901)
NotImplemented is a special value which should be returned by the binary special methods to indicate that the operation is not implemented with respect to the other type. Raise NotImplementedError to indicate that a super-class method is not implemented and that child classes should implement it. ...
🌐
TutorialsPoint
tutorialspoint.com › How-to-catch-NotImplementedError-Exception-in-Python
How to catch NotImplementedError Exception in Python?
The NotImplementedError exception in Python is raised when an abstract method or operation that should be implemented by a subclass is not implemented. It is commonly used as a placeholder in base classes to indicate that subclasses are expected to o
🌐
Medium
leapcell.medium.com › elegant-abstractions-mastering-abstract-base-classes-in-advanced-python-bf3739dd815e
Elegant Abstractions: Mastering ABCs in Advanced Python | by Leapcell | Medium
May 2, 2025 - Abstract base classes are very suitable for implementing design patterns such as the factory pattern and the strategy pattern. Many Python developers use NotImplementedError to mark methods that need to be implemented by subclasses: class LeapCellFileHandler: def read(self, filename: str) -> Dict: raise NotImplementedError("Subclass must implement read method") def write(self, filename: str, data: Dict) -> None: raise NotImplementedError("Subclass must implement write method")
🌐
LabEx
labex.io › tutorials › python-how-to-handle-notimplementederror-in-python-programming-398203
How to handle NotImplementedError in Python programming | LabEx
NotImplementedError is a built-in exception in Python that is raised when a method or function has not been implemented yet. This error is typically raised when you have a base class that defines an abstract method, and a derived class fails ...