Skip to content

Commit c589a70

Browse files
committed
#9438: clarify that constant names also cannot be assigned as attributes.
1 parent 9499bb7 commit c589a70

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

Doc/library/constants.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ Built-in Constants
33

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

6-
7-
.. note::
8-
9-
:data:`None`, :data:`False`, :data:`True` and :data:`__debug__` cannot be
10-
reassigned (assignments to them raise :exc:`SyntaxError`), so they can be
11-
considered "true" constants.
12-
13-
.. XXX False, True, None are keywords too
14-
156
.. data:: False
167

178
The false value of the :class:`bool` type. Assignments to ``False``
@@ -50,6 +41,12 @@ A small number of constants live in the built-in namespace. They are:
5041
Assignments to :const:`__debug__` are illegal and raise a :exc:`SyntaxError`.
5142
See also the :keyword:`assert` statement.
5243

44+
.. note::
45+
46+
The names :data:`None`, :data:`False`, :data:`True` and :data:`__debug__`
47+
cannot be reassigned (assignments to them, even as an attribute name, raise
48+
:exc:`SyntaxError`), so they can be considered "true" constants.
49+
5350

5451
Constants added by the :mod:`site` module
5552
-----------------------------------------

0 commit comments

Comments
 (0)