@@ -6,7 +6,7 @@ Boolean Objects
6
6
---------------
7
7
8
8
Booleans in Python are implemented as a subclass of integers. There are only
9
- two booleans, :const: `Py_False ` and :const : `Py_True `. As such, the normal
9
+ two booleans, :c:data: `Py_False ` and :c:data : `Py_True `. As such, the normal
10
10
creation and deletion functions don't apply to booleans. The following macros
11
11
are available, however.
12
12
@@ -19,29 +19,32 @@ are available, however.
19
19
20
20
.. c :var :: PyObject* Py_False
21
21
22
- The Python ``False `` object. This object has no methods. It needs to be
23
- treated just like any other object with respect to reference counts.
22
+ The Python ``False `` object. This object has no methods and is
23
+ `immortal <https://peps.python.org/pep-0683/ >`_.
24
+
25
+ .. versionchanged :: 3.12
26
+ :c:data: `Py_False ` is immortal.
24
27
25
28
26
29
.. c :var :: PyObject* Py_True
27
30
28
- The Python ``True `` object. This object has no methods. It needs to be treated
29
- just like any other object with respect to reference counts.
31
+ The Python ``True `` object. This object has no methods and is
32
+ `immortal <https://peps.python.org/pep-0683/ >`_.
33
+
34
+ .. versionchanged :: 3.12
35
+ :c:data: `Py_True ` is immortal.
30
36
31
37
32
38
.. c :macro :: Py_RETURN_FALSE
33
39
34
- Return :const: `Py_False ` from a function, properly incrementing its reference
35
- count.
40
+ Return :c:data: `Py_False ` from a function.
36
41
37
42
38
43
.. c :macro :: Py_RETURN_TRUE
39
44
40
- Return :const: `Py_True ` from a function, properly incrementing its reference
41
- count.
45
+ Return :c:data: `Py_True ` from a function.
42
46
43
47
44
48
.. c :function :: PyObject* PyBool_FromLong (long v)
45
49
46
- Return a new reference to :const :`Py_True` or :const :`Py_False` depending on the
47
- truth value of *v*.
50
+ Return :c:data:`Py_True` or :c:data:`Py_False`, depending on the truth value of *v*.
0 commit comments