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

None

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


Import & Availability

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

Overview & Signature

None -> NoneType

The type of the None singleton.

Usage

def find_user(uid: int) -> str | None:
    return "Ada" if uid == 1 else None

assert find_user(2) is None
assert find_user(1) is not None

Gotchas

REPL Inspect

help(None)

Linked from

Related notes