On this page
object
Prev: next | Up: __builtins__ | Next: oct
Rel: bool, int, float, complex, str, Python Object, MRO & Initialization Dunder Flow, Object-Oriented Programming (OOP)
Ref: docs.python.org — object
Tags: #public #python3 #builtins
Import & Availability
# Built-in (available globally without import)
from builtins import object
Overview & Signature
object()
The base class of the class hierarchy.
Usage
MISSING = object() # unique sentinel that can never collide with None or False
assert MISSING is not object()
Gotchas
- Best sentinel pattern (
_MISSING = object()): Ideal whenNoneis a valid user value. - Cannot attach dynamic attributes to plain
object()(it has no__dict__—usetypes.SimpleNamespacefor a bag of attributes).
REPL Inspect
help(object)
Linked from
- tuts/python3/__builtins__
- tuts/python3/__builtins__/__builtins__
- tuts/python3/__builtins__/next
- tuts/python3/__builtins__/oct
- tuts/python3/tutorials/advanced_python_internals/python_object_mro_and_initialization
- tuts/python3/tutorials/intermediate_python_and_software_engineering/object_oriented_programming
Related notes
- tuts/python3/__builtins__/__builtins__ Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/next Linked here; links to this page; shared tags: #builtins
- tuts/python3/__builtins__/oct Linked here; links to this page; shared tags: #builtins
- tuts/python3/tutorials/advanced_python_internals/python_object_mro_and_initialization Linked here; links to this page
- tuts/python3/tutorials/intermediate_python_and_software_engineering/object_oriented_programming Linked here; links to this page
- tuts/python3/__builtins__ links to this page; shared tags: #builtins
- tuts/python3/__builtins__/bool Linked here; shared tags: #builtins
- tuts/python3/__builtins__/complex Linked here; shared tags: #builtins
- tuts/python3/__builtins__/float Linked here; shared tags: #builtins
- tuts/python3/__builtins__/int Linked here; shared tags: #builtins