constants.rst 2.24 KB

Built-in Constants

A small number of constants live in the built-in namespace. They are:

Note

The names :data:`None`, :data:`False`, :data:`True` and :data:`__debug__` cannot be reassigned (assignments to them, even as an attribute name, raise :exc:`SyntaxError`), so they can be considered "true" constants.

Constants added by the :mod:`site` module

The :mod:`site` module (which is imported automatically during startup, except if the :option:`-S` command-line option is given) adds several constants to the built-in namespace. They are useful for the interactive interpreter shell and should not be used in programs.