blob: 7e6397824c5de5a3a602e6003f79ee7afc87fabe [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001
2Built-in Constants
3==================
4
5A small number of constants live in the built-in namespace. They are:
6
7
8.. data:: False
9
10 The false value of the :class:`bool` type.
11
12 .. versionadded:: 2.3
13
14
15.. data:: True
16
17 The true value of the :class:`bool` type.
18
19 .. versionadded:: 2.3
20
21
22.. data:: None
23
24 The sole value of :attr:`types.NoneType`. ``None`` is frequently used to
25 represent the absence of a value, as when default arguments are not passed to a
26 function.
27
Georg Brandlb19be572007-12-29 10:57:00 +000028 .. versionchanged:: 2.4
29 Assignments to ``None`` are illegal and raise a :exc:`SyntaxError`.
30
Georg Brandl8ec7f652007-08-15 14:28:01 +000031
32.. data:: NotImplemented
33
34 Special value which can be returned by the "rich comparison" special methods
35 (:meth:`__eq__`, :meth:`__lt__`, and friends), to indicate that the comparison
36 is not implemented with respect to the other type.
37
38
39.. data:: Ellipsis
40
41 Special value used in conjunction with extended slicing syntax.
42
Georg Brandlb19be572007-12-29 10:57:00 +000043 .. XXX Someone who understands extended slicing should fill in here.
Georg Brandl8ec7f652007-08-15 14:28:01 +000044
Georg Brandlb19be572007-12-29 10:57:00 +000045
46.. data:: __debug__
47
48 This constant is true if Python was not started with an :option:`-O` option.
49 Assignments to :const:`__debug__` are illegal and raise a :exc:`SyntaxError`.
50 See also the :keyword:`assert` statement.