Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 89996d9

Browse files
committed
Catch up with main
2 parents 27a50cf + 14fd86a commit 89996d9

88 files changed

Lines changed: 2787 additions & 1800 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ Objects/type* @markshannon
2828
Objects/codeobject.c @markshannon
2929
Objects/frameobject.c @markshannon
3030
Objects/call.c @markshannon
31-
Python/ceval.c @markshannon
31+
Python/ceval*.c @markshannon @gvanrossum
32+
Python/ceval*.h @markshannon @gvanrossum
3233
Python/compile.c @markshannon @iritkatriel
3334
Python/assemble.c @markshannon @iritkatriel
3435
Python/flowgraph.c @markshannon @iritkatriel
3536
Python/ast_opt.c @isidentical
37+
Python/bytecodes.c @markshannon @gvanrossum
38+
Python/optimizer*.c @markshannon @gvanrossum
3639
Lib/test/test_patma.py @brandtbucher
3740
Lib/test/test_peepholer.py @brandtbucher
3841
Lib/test/test_type_*.py @JelleZijlstra
42+
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
3943

4044
# Exceptions
4145
Lib/traceback.py @iritkatriel
@@ -102,6 +106,9 @@ Include/internal/pycore_time.h @pganssle @abalkin
102106
/Lib/tokenize.py @pablogsal @lysnikolaou
103107
/Lib/test/test_tokenize.py @pablogsal @lysnikolaou
104108

109+
# Code generator
110+
/Tools/cases_generator/ @gvanrossum
111+
105112
# AST
106113
Python/ast.c @isidentical
107114
Parser/asdl.py @isidentical
@@ -151,7 +158,7 @@ Doc/c-api/stable.rst @encukou
151158

152159
**/*idlelib* @terryjreedy
153160

154-
**/*typing* @gvanrossum @JelleZijlstra @AlexWaygood
161+
**/*typing* @JelleZijlstra @AlexWaygood
155162

156163
**/*ftplib @giampaolo
157164
**/*shutil @giampaolo

.github/workflows/build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ jobs:
120120

121121
check_generated_files:
122122
name: 'Check if generated files are up to date'
123-
runs-on: ubuntu-latest
123+
# Don't use ubuntu-latest but a specific version to make the job
124+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
125+
runs-on: ubuntu-22.04
124126
timeout-minutes: 60
125127
needs: check_source
126128
if: needs.check_source.outputs.run_tests == 'true'
@@ -143,15 +145,16 @@ jobs:
143145
- name: Check Autoconf and aclocal versions
144146
run: |
145147
grep "Generated by GNU Autoconf 2.71" configure
146-
grep "aclocal 1.16.4" aclocal.m4
148+
grep "aclocal 1.16.5" aclocal.m4
147149
grep -q "runstatedir" configure
148150
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
149151
- name: Configure CPython
150152
run: |
151153
# Build Python with the libpython dynamic library
152154
./configure --config-cache --with-pydebug --enable-shared
153-
- name: Regenerate autoconf files with container image
154-
run: make regen-configure
155+
- name: Regenerate autoconf files
156+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
157+
run: autoreconf -ivf -Werror
155158
- name: Build CPython
156159
run: |
157160
make -j4 regen-all

.github/workflows/posix-deps-apt.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/bin/sh
22
apt-get update
33

4+
# autoconf-archive is needed by autoreconf (check_generated_files job)
45
apt-get -yq install \
56
build-essential \
67
pkg-config \
8+
autoconf-archive \
79
ccache \
810
gdb \
911
lcov \

Doc/c-api/bool.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ are available, however.
2626
.. c:var:: PyObject* Py_False
2727
2828
The Python ``False`` object. This object has no methods and is
29-
`immortal <https://peps.python.org/pep-0683/>`_.
29+
:term:`immortal`.
3030
31-
.. versionchanged:: 3.12
32-
:c:data:`Py_False` is immortal.
31+
.. versionchanged:: 3.12
32+
:c:data:`Py_False` is :term:`immortal`.
3333
3434
3535
.. c:var:: PyObject* Py_True
3636
3737
The Python ``True`` object. This object has no methods and is
38-
`immortal <https://peps.python.org/pep-0683/>`_.
38+
:term:`immortal`.
3939
40-
.. versionchanged:: 3.12
41-
:c:data:`Py_True` is immortal.
40+
.. versionchanged:: 3.12
41+
:c:data:`Py_True` is :term:`immortal`.
4242
4343
4444
.. c:macro:: Py_RETURN_FALSE

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ otherwise immutable (e.g. ``None``, ``(1, 5)``) can't normally be shared
14851485
because of the refcount. One simple but less-efficient approach around
14861486
this is to use a global lock around all use of some state (or object).
14871487
Alternately, effectively immutable objects (like integers or strings)
1488-
can be made safe in spite of their refcounts by making them "immortal".
1488+
can be made safe in spite of their refcounts by making them :term:`immortal`.
14891489
In fact, this has been done for the builtin singletons, small integers,
14901490
and a number of other builtin objects.
14911491

Doc/c-api/init_config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,7 @@ PyConfig
11701170
11711171
.. c:member:: int show_ref_count
11721172
1173-
Show total reference count at exit (excluding immortal objects)?
1173+
Show total reference count at exit (excluding :term:`immortal` objects)?
11741174
11751175
Set to ``1`` by :option:`-X showrefcount <-X>` command line option.
11761176

Doc/c-api/none.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ same reason.
1616
.. c:var:: PyObject* Py_None
1717
1818
The Python ``None`` object, denoting lack of value. This object has no methods
19-
and is `immortal <https://peps.python.org/pep-0683/>`_.
19+
and is :term:`immortal`.
2020

21-
.. versionchanged:: 3.12
22-
:c:data:`Py_None` is immortal.
21+
.. versionchanged:: 3.12
22+
:c:data:`Py_None` is :term:`immortal`.
2323

2424
.. c:macro:: Py_RETURN_NONE
2525

Doc/c-api/refcounting.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ of Python objects.
1717
1818
Note that the returned value may not actually reflect how many
1919
references to the object are actually held. For example, some
20-
objects are "immortal" and have a very high refcount that does not
20+
objects are :term:`immortal` and have a very high refcount that does not
2121
reflect the actual number of references. Consequently, do not rely
2222
on the returned value to be accurate, other than a value of 0 or 1.
2323
@@ -34,9 +34,7 @@ of Python objects.
3434
3535
Set the object *o* reference counter to *refcnt*.
3636
37-
Note that this function has no effect on
38-
`immortal <https://peps.python.org/pep-0683/>`_
39-
objects.
37+
This function has no effect on :term:`immortal` objects.
4038
4139
.. versionadded:: 3.9
4240
@@ -49,6 +47,8 @@ of Python objects.
4947
Indicate taking a new :term:`strong reference` to object *o*,
5048
indicating it is in use and should not be destroyed.
5149
50+
This function has no effect on :term:`immortal` objects.
51+
5252
This function is usually used to convert a :term:`borrowed reference` to a
5353
:term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be
5454
used to create a new :term:`strong reference`.
@@ -113,6 +113,8 @@ of Python objects.
113113
Release a :term:`strong reference` to object *o*, indicating the
114114
reference is no longer used.
115115
116+
This function has no effect on :term:`immortal` objects.
117+
116118
Once the last :term:`strong reference` is released
117119
(i.e. the object's reference count reaches 0),
118120
the object's type's deallocation

Doc/c-api/slice.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ Ellipsis Object
119119
.. c:var:: PyObject *Py_Ellipsis
120120
121121
The Python ``Ellipsis`` object. This object has no methods. Like
122-
:c:data:`Py_None`, it is an `immortal <https://peps.python.org/pep-0683/>`_.
123-
singleton object.
122+
:c:data:`Py_None`, it is an :term:`immortal` singleton object.
124123
125124
.. versionchanged:: 3.12
126125
:c:data:`Py_Ellipsis` is immortal.

Doc/glossary.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,16 @@ Glossary
579579
:ref:`idle` is a basic editor and interpreter environment
580580
which ships with the standard distribution of Python.
581581

582+
immortal
583+
If an object is immortal, its reference count is never modified, and
584+
therefore it is never deallocated.
585+
586+
Built-in strings and singletons are immortal objects. For example,
587+
:const:`True` and :const:`None` singletons are immmortal.
588+
589+
See `PEP 683 – Immortal Objects, Using a Fixed Refcount
590+
<https://peps.python.org/pep-0683/>`_ for more information.
591+
582592
immutable
583593
An object with a fixed value. Immutable objects include numbers, strings and
584594
tuples. Such an object cannot be altered. A new object has to
@@ -1056,7 +1066,7 @@ Glossary
10561066
reference count
10571067
The number of references to an object. When the reference count of an
10581068
object drops to zero, it is deallocated. Some objects are
1059-
"immortal" and have reference counts that are never modified, and
1069+
:term:`immortal` and have reference counts that are never modified, and
10601070
therefore the objects are never deallocated. Reference counting is
10611071
generally not visible to Python code, but it is a key element of the
10621072
:term:`CPython` implementation. Programmers can call the

0 commit comments

Comments
 (0)