Skip to content

Commit 867f283

Browse files
Merge remote-tracking branch 'upstream/main' into dynamic_opcode_targets
2 parents 00caa65 + 571210b commit 867f283

File tree

89 files changed

+2664
-1520
lines changed

Some content is hidden

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

89 files changed

+2664
-1520
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,15 @@ Lib/test/test_dataclasses/ @ericvsmith
406406

407407
# Dates and times
408408
Doc/**/*time.rst @pganssle @abalkin
409+
Doc/library/zoneinfo.rst @pganssle
409410
Include/datetime.h @pganssle @abalkin
410411
Include/internal/pycore_time.h @pganssle @abalkin
412+
Lib/test/test_zoneinfo/ @pganssle
413+
Lib/zoneinfo/ @pganssle
411414
Lib/*time.py @pganssle @abalkin
412415
Lib/test/datetimetester.py @pganssle @abalkin
413416
Lib/test/test_*time.py @pganssle @abalkin
417+
Modules/*zoneinfo* @pganssle
414418
Modules/*time* @pganssle @abalkin
415419
Python/pytime.c @pganssle @abalkin
416420

.github/workflows/jit.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,33 @@ jobs:
134134
make all --jobs 4
135135
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
136136
137+
no-opt-jit:
138+
name: JIT without optimizations (Debug)
139+
needs: interpreter
140+
runs-on: ubuntu-24.04
141+
timeout-minutes: 90
142+
strategy:
143+
fail-fast: false
144+
matrix:
145+
llvm:
146+
- 19
147+
steps:
148+
- uses: actions/checkout@v4
149+
with:
150+
persist-credentials: false
151+
- uses: actions/setup-python@v5
152+
with:
153+
python-version: '3.11'
154+
- name: Build with JIT
155+
run: |
156+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
157+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
158+
./configure --enable-experimental-jit --with-pydebug
159+
make all --jobs 4
160+
- name: Run tests without optimizations
161+
run: |
162+
PYTHON_UOPS_OPTIMIZE=0 ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
163+
137164
# XXX: GH-133171
138165
# jit-with-disabled-gil:
139166
# name: Free-Threaded (Debug)

Doc/c-api/unicode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ APIs:
747747
Return ``0`` on success, ``-1`` on error with an exception set.
748748
749749
This function checks that *unicode* is a Unicode object, that the index is
750-
not out of bounds, and that the object's reference count is one).
750+
not out of bounds, and that the object's reference count is one.
751751
See :c:func:`PyUnicode_WRITE` for a version that skips these checks,
752752
making them your responsibility.
753753

Doc/c-api/veryhigh.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ the same library that the Python runtime is using.
183183
objects *globals* and *locals* with the compiler flags specified by
184184
*flags*. *globals* must be a dictionary; *locals* can be any object
185185
that implements the mapping protocol. The parameter *start* specifies
186-
the start token that should be used to parse the source code.
186+
the start symbol and must one of the following:
187+
:c:data:`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`.
187188
188189
Returns the result of executing the code as a Python object, or ``NULL`` if an
189190
exception was raised.
@@ -231,7 +232,7 @@ the same library that the Python runtime is using.
231232
.. c:function:: PyObject* Py_CompileStringObject(const char *str, PyObject *filename, int start, PyCompilerFlags *flags, int optimize)
232233
233234
Parse and compile the Python source code in *str*, returning the resulting code
234-
object. The start token is given by *start*; this can be used to constrain the
235+
object. The start symbol is given by *start*; this can be used to constrain the
235236
code which can be compiled and should be :c:data:`Py_eval_input`,
236237
:c:data:`Py_file_input`, or :c:data:`Py_single_input`. The filename specified by
237238
*filename* is used to construct the code object and may appear in tracebacks or

Doc/library/argparse.rst

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -774,16 +774,16 @@ how the command-line arguments should be handled. The supplied actions are:
774774
>>> parser.parse_args('--foo --bar'.split())
775775
Namespace(foo=True, bar=False, baz=True)
776776

777-
* ``'append'`` - This stores a list, and appends each argument value to the
778-
list. It is useful to allow an option to be specified multiple times.
779-
If the default value is non-empty, the default elements will be present
780-
in the parsed value for the option, with any values from the
781-
command line appended after those default values. Example usage::
777+
* ``'append'`` - This appends each argument value to a list.
778+
It is useful for allowing an option to be specified multiple times.
779+
If the default value is a non-empty list, the parsed value will start
780+
with the default list's elements and any values from the command line
781+
will be appended after those default values. Example usage::
782782

783783
>>> parser = argparse.ArgumentParser()
784-
>>> parser.add_argument('--foo', action='append')
784+
>>> parser.add_argument('--foo', action='append', default=['0'])
785785
>>> parser.parse_args('--foo 1 --foo 2'.split())
786-
Namespace(foo=['1', '2'])
786+
Namespace(foo=['0', '1', '2'])
787787

788788
* ``'append_const'`` - This stores a list, and appends the value specified by
789789
the const_ keyword argument to the list; note that the const_ keyword
@@ -981,8 +981,8 @@ the various :class:`ArgumentParser` actions. The two most common uses of it are
981981
(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional
982982
argument that can be followed by zero or one command-line arguments.
983983
When parsing the command line, if the option string is encountered with no
984-
command-line argument following it, the value of ``const`` will be assumed to
985-
be ``None`` instead. See the nargs_ description for examples.
984+
command-line argument following it, the value from ``const`` will be used.
985+
See the nargs_ description for examples.
986986

987987
.. versionchanged:: 3.11
988988
``const=None`` by default, including when ``action='append_const'`` or
@@ -1142,16 +1142,21 @@ if the argument was not one of the acceptable values::
11421142
game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',
11431143
'paper', 'scissors')
11441144

1145-
Note that inclusion in the *choices* sequence is checked after any type_
1146-
conversions have been performed, so the type of the objects in the *choices*
1147-
sequence should match the type_ specified.
1148-
11491145
Any sequence can be passed as the *choices* value, so :class:`list` objects,
11501146
:class:`tuple` objects, and custom sequences are all supported.
11511147

11521148
Use of :class:`enum.Enum` is not recommended because it is difficult to
11531149
control its appearance in usage, help, and error messages.
11541150

1151+
Note that *choices* are checked after any type_
1152+
conversions have been performed, so objects in *choices*
1153+
should match the type_ specified. This can make *choices*
1154+
appear unfamiliar in usage, help, or error messages.
1155+
1156+
To keep *choices* user-friendly, consider a custom type wrapper that
1157+
converts and formats values, or omit type_ and handle conversion in
1158+
your application code.
1159+
11551160
Formatted choices override the default *metavar* which is normally derived
11561161
from *dest*. This is usually what you want because the user never sees the
11571162
*dest* parameter. If this display isn't desirable (perhaps because there are

Doc/library/platform.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Cross platform
5656
Returns the machine type, e.g. ``'AMD64'``. An empty string is returned if the
5757
value cannot be determined.
5858

59+
The output is platform-dependent and may differ in casing and naming conventions.
60+
5961

6062
.. function:: node()
6163

Doc/library/sqlite3.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ Connection objects
620620
supplied, this must be a :term:`callable` returning
621621
an instance of :class:`Cursor` or its subclasses.
622622

623-
.. method:: blobopen(table, column, row, /, *, readonly=False, name="main")
623+
.. method:: blobopen(table, column, rowid, /, *, readonly=False, name="main")
624624

625625
Open a :class:`Blob` handle to an existing
626626
:abbr:`BLOB (Binary Large OBject)`.
@@ -631,8 +631,8 @@ Connection objects
631631
:param str column:
632632
The name of the column where the blob is located.
633633

634-
:param str row:
635-
The name of the row where the blob is located.
634+
:param int rowid:
635+
The row id where the blob is located.
636636

637637
:param bool readonly:
638638
Set to ``True`` if the blob should be opened without write

Doc/whatsnew/3.15.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,13 @@ shelve
404404
(Contributed by Andrea Oliveri in :gh:`134004`.)
405405

406406

407+
socket
408+
------
409+
410+
* Add constants for the ISO-TP CAN protocol.
411+
(Contributed by Patrick Menschel and Stefan Tatschner in :gh:`86819`.)
412+
413+
407414
sqlite3
408415
-------
409416

Include/cpython/pystate.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ struct _ts {
157157
*/
158158
unsigned long native_thread_id;
159159

160+
/* List of objects that still need to be cleaned up, singly linked
161+
* via their gc headers' gc_next pointers. The list is populated by
162+
* _PyTrash_thread_deposit_object and cleaned up by
163+
* _PyTrash_thread_destroy_chain.
164+
*/
160165
PyObject *delete_later;
161166

162167
/* Tagged pointer to top-most critical section, or zero if there is no

Include/internal/pycore_call.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ _PyObject_CallNoArgs(PyObject *func) {
186186
}
187187

188188

189-
extern PyObject *const *
189+
PyAPI_FUNC(PyObject *const *)
190190
_PyStack_UnpackDict(PyThreadState *tstate,
191191
PyObject *const *args, Py_ssize_t nargs,
192192
PyObject *kwargs, PyObject **p_kwnames);
@@ -196,7 +196,7 @@ extern void _PyStack_UnpackDict_Free(
196196
Py_ssize_t nargs,
197197
PyObject *kwnames);
198198

199-
extern void _PyStack_UnpackDict_FreeNoDecRef(
199+
PyAPI_FUNC(void) _PyStack_UnpackDict_FreeNoDecRef(
200200
PyObject *const *stack,
201201
PyObject *kwnames);
202202

0 commit comments

Comments
 (0)