Skip to content

Commit cf3b36c

Browse files
authored
Merge branch 'python:main' into azure-ubuntu-24.04
2 parents cccb4df + d57f8a9 commit cf3b36c

40 files changed

+853
-446
lines changed

.readthedocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sphinx:
88
configuration: Doc/conf.py
99

1010
build:
11-
os: ubuntu-22.04
11+
os: ubuntu-24.04
1212
tools:
1313
python: "3"
1414

Doc/c-api/typeobj.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
650650
(doesn't have the :c:macro:`Py_TPFLAGS_BASETYPE` flag bit set), it is
651651
permissible to call the object deallocator directly instead of via
652652
:c:member:`~PyTypeObject.tp_free`. The object deallocator should be the one used to allocate the
653-
instance; this is normally :c:func:`PyObject_Del` if the instance was allocated
653+
instance; this is normally :c:func:`PyObject_Free` if the instance was allocated
654654
using :c:macro:`PyObject_New` or :c:macro:`PyObject_NewVar`, or
655655
:c:func:`PyObject_GC_Del` if the instance was allocated using
656656
:c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`.
@@ -1954,7 +1954,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
19541954
match :c:func:`PyType_GenericAlloc` and the value of the
19551955
:c:macro:`Py_TPFLAGS_HAVE_GC` flag bit.
19561956

1957-
For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Del`.
1957+
For static subtypes, :c:data:`PyBaseObject_Type` uses :c:func:`PyObject_Free`.
19581958

19591959

19601960
.. c:member:: inquiry PyTypeObject.tp_is_gc

Doc/data/refcounts.dat

-10
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,6 @@ PyComplex_RealAsDouble:PyObject*:op:0:
364364
PyContext_CheckExact:int:::
365365
PyContext_CheckExact:PyObject*:o:0:
366366

367-
PyContext_ClearFreeList:int:::
368-
369367
PyContext_Copy:PyObject*::+1:
370368
PyContext_Copy:PyObject*:ctx:0:
371369

@@ -1030,8 +1028,6 @@ PyImport_AddModule:const char*:name::
10301028
PyImport_AddModuleObject:PyObject*::0:reference borrowed from sys.modules
10311029
PyImport_AddModuleObject:PyObject*:name:0:
10321030

1033-
PyImport_Cleanup:void:::
1034-
10351031
PyImport_ExecCodeModule:PyObject*::+1:
10361032
PyImport_ExecCodeModule:const char*:name::
10371033
PyImport_ExecCodeModule:PyObject*:co:0:
@@ -2405,12 +2401,6 @@ PyUnicode_DATA:PyObject*:o:0:
24052401
PyUnicode_GET_LENGTH:Py_ssize_t:::
24062402
PyUnicode_GET_LENGTH:PyObject*:o:0:
24072403

2408-
PyUnicode_GET_SIZE:Py_ssize_t:::
2409-
PyUnicode_GET_SIZE:PyObject*:o:0:
2410-
2411-
PyUnicode_GET_DATA_SIZE:Py_ssize_t:::
2412-
PyUnicode_GET_DATA_SIZE:PyObject*:o:0:
2413-
24142404
PyUnicode_KIND:int:::
24152405
PyUnicode_KIND:PyObject*:o:0:
24162406

Doc/tools/templates/download.html

+42-32
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends "layout.html" %}
2-
{% set title = 'Download' %}
2+
{% set title = _('Download') %}
33
{% if daily is defined %}
44
{% set dlbase = pathto('archives', 1) %}
55
{% else %}
@@ -11,58 +11,68 @@
1111
{% endif %}
1212

1313
{% block body %}
14-
<h1>Download Python {{ release }} Documentation</h1>
14+
<h1>{% trans %}Download Python {{ release }} Documentation{% endtrans %}</h1>
1515

16-
{% if last_updated %}<p><b>Last updated on: {{ last_updated }}.</b></p>{% endif %}
16+
{% if last_updated %}<p><b>{% trans %}Last updated on: {{ last_updated }}.{% endtrans %}</b></p>{% endif %}
1717

18-
<p>To download an archive containing all the documents for this version of
19-
Python in one of various formats, follow one of links in this table.</p>
18+
<p>{% trans %}To download an archive containing all the documents for this version of
19+
Python in one of various formats, follow one of links in this table.{% endtrans %}</p>
2020

2121
<table class="docutils">
22-
<tr><th>Format</th><th>Packed as .zip</th><th>Packed as .tar.bz2</th></tr>
23-
<tr><td>PDF (US-Letter paper size)</td>
24-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-pdf-letter.zip">Download</a> (ca. 17 MiB)</td>
25-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-pdf-letter.tar.bz2">Download</a> (ca. 17 MiB)</td>
22+
<tr>
23+
<th>{% trans %}Format{% endtrans %}</th>
24+
<th>{% trans %}Packed as .zip{% endtrans %}</th>
25+
<th>{% trans %}Packed as .tar.bz2{% endtrans %}</th>
2626
</tr>
27-
<tr><td>PDF (A4 paper size)</td>
28-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-pdf-a4.zip">Download</a> (ca. 17 MiB)</td>
29-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-pdf-a4.tar.bz2">Download</a> (ca. 17 MiB)</td>
27+
<tr>
28+
<td>{% trans %}PDF (US-Letter paper size){% endtrans %}</td>
29+
<td>{% trans download_size="17" %}<a href="{{ dlbase }}/python-{{ release }}-docs-pdf-letter.zip">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
30+
<td>{% trans download_size="17" %}<a href="{{ dlbase }}/python-{{ release }}-docs-pdf-letter.tar.bz2">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
3031
</tr>
31-
<tr><td>HTML</td>
32-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-html.zip">Download</a> (ca. 13 MiB)</td>
33-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-html.tar.bz2">Download</a> (ca. 8 MiB)</td>
32+
<tr>
33+
<td>{% trans %}PDF (A4 paper size){% endtrans %}</td>
34+
<td>{% trans download_size="17" %}<a href="{{ dlbase }}/python-{{ release }}-docs-pdf-a4.zip">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
35+
<td>{% trans download_size="17" %}<a href="{{ dlbase }}/python-{{ release }}-docs-pdf-a4.tar.bz2">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
3436
</tr>
35-
<tr><td>Plain text</td>
36-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-text.zip">Download</a> (ca. 4 MiB)</td>
37-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-text.tar.bz2">Download</a> (ca. 3 MiB)</td>
37+
<tr>
38+
<td>{% trans %}HTML{% endtrans %}</td>
39+
<td>{% trans download_size="13" %}<a href="{{ dlbase }}/python-{{ release }}-docs-html.zip">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
40+
<td>{% trans download_size="8" %}<a href="{{ dlbase }}/python-{{ release }}-docs-html.tar.bz2">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
3841
</tr>
39-
<tr><td>Texinfo</td>
40-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-texinfo.zip">Download</a> (ca. 9 MiB)</td>
41-
<td><a href="{{ dlbase }}/python-{{ release }}-docs-texinfo.tar.bz2">Download</a> (ca. 7 MiB)</td>
42+
<tr>
43+
<td>{% trans %}Plain text{% endtrans %}</td>
44+
<td>{% trans download_size="4" %}<a href="{{ dlbase }}/python-{{ release }}-docs-text.zip">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
45+
<td>{% trans download_size="3" %}<a href="{{ dlbase }}/python-{{ release }}-docs-text.tar.bz2">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
46+
</tr>
47+
<tr>
48+
<td>{% trans %}Texinfo{% endtrans %}</td>
49+
<td>{% trans download_size="9" %}<a href="{{ dlbase }}/python-{{ release }}-docs-texinfo.zip">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
50+
<td>{% trans download_size="7" %}<a href="{{ dlbase }}/python-{{ release }}-docs-texinfo.tar.bz2">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
4251
</tr>
43-
<tr><td>EPUB</td>
44-
<td><a href="{{ dlbase }}/python-{{ release }}-docs.epub">Download</a> (ca. 6 MiB)</td>
52+
<tr>
53+
<td>{% trans %}EPUB{% endtrans %}</td>
54+
<td>{% trans download_size="6" %}<a href="{{ dlbase }}/python-{{ release }}-docs.epub">Download</a> (ca. {{ download_size }} MiB){% endtrans %}</td>
4555
<td></td>
4656
</tr>
4757
</table>
4858

49-
<p>These archives contain all the content in the documentation.</p>
59+
<p>{% trans %}These archives contain all the content in the documentation.{% endtrans %}</p>
5060

5161

52-
<h2>Unpacking</h2>
62+
<h2>{% trans %}Unpacking{% endtrans %}</h2>
5363

54-
<p>Unix users should download the .tar.bz2 archives; these are bzipped tar
64+
<p>{% trans %}Unix users should download the .tar.bz2 archives; these are bzipped tar
5565
archives and can be handled in the usual way using tar and the bzip2
5666
program. The <a href="https://infozip.sourceforge.net">Info-ZIP</a> unzip program can be
5767
used to handle the ZIP archives if desired. The .tar.bz2 archives provide the
58-
best compression and fastest download times.</p>
68+
best compression and fastest download times.{% endtrans %}</p>
5969

60-
<p>Windows users can use the ZIP archives since those are customary on that
61-
platform. These are created on Unix using the Info-ZIP zip program.</p>
70+
<p>{% trans %}Windows users can use the ZIP archives since those are customary on that
71+
platform. These are created on Unix using the Info-ZIP zip program.{% endtrans %}</p>
6272

6373

64-
<h2>Problems</h2>
74+
<h2>{% trans %}Problems{% endtrans %}</h2>
6575

66-
<p>If you have comments or suggestions for the Python documentation, please send
67-
email to <a href="mailto:[email protected]">[email protected]</a>.</p>
76+
<p>{% trans %}If you have comments or suggestions for the Python documentation, please send
77+
email to <a href="mailto:[email protected]">[email protected]</a>.{% endtrans %}</p>
6878
{% endblock %}

Include/internal/pycore_opcode_metadata.h

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/internal/pycore_optimizer.h

+10
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,16 @@ PyAPI_FUNC(PyObject *) _Py_uop_symbols_test(PyObject *self, PyObject *ignored);
259259

260260
PyAPI_FUNC(int) _PyOptimizer_Optimize(struct _PyInterpreterFrame *frame, _Py_CODEUNIT *start, _PyStackRef *stack_pointer, _PyExecutorObject **exec_ptr);
261261

262+
static inline int is_terminator(const _PyUOpInstruction *uop)
263+
{
264+
int opcode = uop->opcode;
265+
return (
266+
opcode == _EXIT_TRACE ||
267+
opcode == _JUMP_TO_TOP ||
268+
opcode == _DYNAMIC_EXIT
269+
);
270+
}
271+
262272
#ifdef __cplusplus
263273
}
264274
#endif

Include/internal/pycore_symtable.h

-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ typedef struct _symtable_entry {
106106
const char *ste_scope_info;
107107

108108
int ste_nested; /* true if block is nested */
109-
unsigned ste_free : 1; /* true if block has free variables */
110-
unsigned ste_child_free : 1; /* true if a child block has free vars,
111-
including free refs to globals */
112109
unsigned ste_generator : 1; /* true if namespace is a generator */
113110
unsigned ste_coroutine : 1; /* true if namespace is a coroutine */
114111
unsigned ste_annotations_used : 1; /* true if there are any annotations in this scope */

0 commit comments

Comments
 (0)