NotImplemented

Built-in ConstantPython 2.0+Intermediate

Returned by special methods to indicate an operation is not supported

Quick Info

Documentation
Official Docs
Python Version
2.0+

Learn by Difficulty

Quick Example

python
# Triggering and catching NotImplemented
try:
    raise NotImplemented("example error")
except NotImplemented as e:
    print(f"Caught NotImplemented: {e}")
    print(f"Type: {type(e).__name__}")

NotImplemented is raised when returned by special methods to indicate an operation is not supported. Always catch specific exceptions rather than bare except clauses.

Try in Playground

Tags

builtinconstantcore