On this page
  1. NotImplemented
  2. Import & Availability
  3. Overview & Signature
  4. Usage
  5. Gotchas
  6. REPL Inspect

NotImplemented

Prev: None | Up: __builtins__ | Next: True
Rel: True, False, None, Ellipsis, copyright
Ref: docs.python.org — NotImplemented
Tags: #public #python3 #builtins


Import & Availability

# Built-in (available globally without import)
from builtins import NotImplemented

Overview & Signature

NotImplemented -> NotImplementedType

The type of the NotImplemented singleton.

Usage

class Box:
    def __init__(self, val: int) -> None: self.val = val
    def __eq__(self, other: object) -> bool:
        if not isinstance(other, Box):
            return NotImplemented
        return self.val == other.val

assert Box(3) == Box(3) and (Box(3) == 3) is False

Gotchas

REPL Inspect

help(NotImplemented)

Linked from

Related notes