Petr Viktorin
589a03a8ce
gh-140550: Initial implementation of PEP 793 – PyModExport (GH-140556)
...
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-11-05 12:31:42 +01:00
Sergey Miryanov
da65f38a94
gh-134786: raise error if Py_TPFLAGS_MANAGED_WEAKREF or Py_TPFLAGS_MANAGED_DICT is used without Py_TPFLAGS_HAVE_GC set ( #135863 )
2025-11-02 16:34:49 +05:30
Serhiy Storchaka
dcf3cc5796
gh-81313: Add the math.integer module (PEP-791) (GH-133909)
2025-10-31 16:13:43 +02:00
Mikhail Efimov
88ad41fa34
gh-139951: Tests on tuple GC tracking ( #140575 )
2025-10-28 10:55:41 +01:00
Ken Jin
a716091227
gh-140104: Set next_instr properly in the JIT during exceptions (GH-140233)
...
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
Co-authored-by: Chris Eibl <138194463+chris-eibl@users.noreply.github.com>
2025-10-27 18:26:47 +00:00
Stefano Rivera
76fea5596c
gh-130317: Fix SNaN broken tests on HP PA RISC ( #140452 )
...
While looking at #140028 , I found some unrelated test regressions in the
3.14 cycle. These seem to all come from #130317 . From what I can tell,
that made Python more correct than it was before. According to [0], HP PA
RISC uses 1 for SNaN and thus a 0 for QNaN.
[0]: https://grouper.ieee.org/groups/1788/email/msg03272.html
2025-10-22 18:36:12 +02:00
Dino Viehland
ff7bb565d8
gh-139924: Add PyFunction_PYFUNC_EVENT_MODIFY_QUALNAME event for function watchers ( #139925 )
...
Add PyFunction_PYFUNC_EVENT_MODIFY_QUALNAME event for function watchers
2025-10-10 15:25:38 -07:00
Victor Stinner
e31c22dbf9
gh-111489: Add PyTuple_FromArray() function ( #139691 )
2025-10-10 08:54:12 +02:00
Bénédikt Tran
3779f2b95e
gh-139393: fix _CALL_LEN JIT tests for tuples ( #139394 )
...
Fix a regression introduced in 7ce25edb8f
where `_PY_NSMALLPOSINTS` was changed from 257 to 1025.
2025-09-28 19:30:44 +02:00
dgpb
7ce25edb8f
gh-133059: Increase the small positive integer cache to 1024 (GH-133160)
2025-09-24 17:05:30 -04:00
Petr Viktorin
61e54e52ea
gh-136003: Close file descriptors in test (GH-139225)
...
This fixes file descriptor leaks introduced in GH-136004
2025-09-22 13:22:27 +02:00
Peter Bierma
2191497933
gh-136003: Execute pre-finalization callbacks in a loop (GH-136004)
2025-09-18 08:29:12 -04:00
Mark Shannon
3b83257366
GH-138378: Move globals-to-consts pass into main optimizer pass (GH-138379)
2025-09-18 10:09:59 +01:00
Savannah Bailey
9c9a0f7da7
GH-132732: Use pure op machinery to optimize various instructions with _POP_TOP and _POP_TWO ( #137577 )
2025-09-15 16:29:45 +01:00
Victor Stinner
c3fca5d478
gh-129813, PEP 782: Add PyBytesWriter_Format() ( #138824 )
...
Modify PyBytes_FromFormatV() to use the public PyBytesWriter API
rather than the _PyBytesWriter private API.
2025-09-12 14:21:57 +02:00
Victor Stinner
adb414044f
gh-129813, PEP 782: Add PyBytesWriter C API ( #138822 )
2025-09-12 13:41:59 +02:00
Serhiy Storchaka
af58a6f883
gh-88886: Remove excessive encoding name normalization (GH-137167)
...
The codecs lookup function now performs only minimal normalization of
the encoding name before passing it to the search functions:
all ASCII letters are converted to lower case, spaces are replaced
with hyphens.
Excessive normalization broke third-party codecs providers, like
python-iconv.
Revert "bpo-37751: Fix codecs.lookup() normalization (GH-15092)"
This reverts commit 20f59fe1f7 .
2025-09-09 21:07:21 +03:00
Petr Viktorin
0c74fc8af0
gh-137210: Add a struct, slot & function for checking an extension's ABI (GH-137212)
...
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2025-09-05 16:23:18 +02:00
Ken Jin
2402f84665
gh-138431: JIT Optimizer --- Fix round-tripping references for str and tuple (GH-138458)
...
Co-authored-by: Mark Shannon <9448417+markshannon@users.noreply.github.com>
2025-09-04 02:05:06 +08:00
Peter Bierma
e8251dc0ae
gh-134170: Add colorization to unraisable exceptions ( #134183 )
...
Default implementation of sys.unraisablehook() now uses traceback._print_exception_bltin() to print exceptions with colorized text.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-08-04 14:35:00 +00:00
Savannah Bailey
f7c380ef67
GH-132732: Use pure op machinery to optimize COMPARE_OP_INT/FLOAT/STR ( #137062 )
...
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2025-07-25 19:02:04 -07:00
Serhiy Storchaka
3a89dfe32b
Revert "gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303)" ( #136991 )
2025-07-22 16:39:50 +03:00
Hood Chatham
7ae4749d06
gh-124621: Emscripten: Add support for async input devices (GH-136822)
...
This is useful for implementing proper `input()`. It requires the
JavaScript engine to support the wasm JSPI spec which is now stage 4.
It is supported on Chrome since version 137 and on Firefox and node
behind a flag.
We override the `__wasi_fd_read()` syscall with our own variant that
checks for a readAsync operation. If it has it, we use our own async
variant of `fd_read()`, otherwise we use the original `fd_read()`.
We also add a variant of `FS.createDevice()` called
`FS.createAsyncInputDevice()`.
Finally, if JSPI is available, we wrap the `main()` symbol with
`WebAssembly.promising()` so that we can stack switch from `fd_read()`.
If JSPI is not available, attempting to read from an AsyncInputDevice
will raise an `OSError`.
2025-07-19 17:14:29 +02:00
Serhiy Storchaka
e18829a8ad
gh-132629: Deprecate accepting out-of-range values for unsigned integers in PyArg_Parse (GH-132630)
...
For unsigned integer formats in the PyArg_Parse* functions,
accepting Python integers with value that is larger than
the maximal value the corresponding C type or less than
the minimal value for the corresponding signed integer type
is now deprecated.
2025-07-13 12:44:54 +03:00
Victor Stinner
da79ac9d26
gh-135075: Make PyObject_SetAttr() fail with NULL value and exception ( #136180 )
...
Make PyObject_SetAttr() and PyObject_SetAttrString() fail if called
with NULL value and an exception set.
2025-07-03 14:51:44 +02:00
Ken Jin
b3308973e3
gh-136183: Deal with escapes in JIT optimizer's constant evaluator (GH-136184)
2025-07-02 14:08:25 +08:00
Noam Cohen
bda121862e
gh-131798: Optimize _UNARY_NEGATIVE (GH-135223)
2025-06-24 03:42:09 +08:00
Ken Jin
569fc6870f
gh-134584: Specialize POP_TOP by reference and type in JIT (GH-135761)
2025-06-24 00:57:14 +08:00
Pastukhov Nikita
3fb6cfe7a9
gh-135721: skip test_trashcan_python_class on wasm buildbots with stack overflow ( #135766 )
2025-06-20 20:06:01 +03:00
Tomas R.
61532b4bc7
gh-131798: JIT: Optimize _CALL_LEN when the length is known ( #135260 )
...
* Add news entry
* Optimize _CALL_LEN
* Simplify tests
2025-06-20 18:21:39 +02:00
Ken Jin
b53b0c14da
gh-135608: Add a null check for attribute promotion to fix a JIT crash (GH-135613)
...
Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
2025-06-20 14:33:35 +08:00
Mark Shannon
9731dd2c8d
GH-135379: Specialize int operations for compact ints only (GH-135668)
2025-06-19 11:10:29 +01:00
Ken Jin
fba5dded6d
gh-134584: Decref elimination for float ops in the JIT (GH-134588)
...
This PR adds a PyJitRef API to the JIT's optimizer that mimics the _PyStackRef API. This allows it to track references and their stack lifetimes properly. Thus opening up the doorway to refcount elimination in the JIT.
2025-06-17 23:25:53 +08:00
Nadeshiko Manju
667a86e076
gh-131798: JIT: replace _CHECK_METHOD_VERSION with _CHECK_FUNCTION_VERSION_INLINE (GH-135022)
...
Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2025-06-16 13:25:50 +08:00
Noam Cohen
b150b6aca7
gh-131798: Optimize _UNARY_INVERT (GH-135222)
2025-06-09 18:33:18 +08:00
Amit Lavon
8fdbbf8b18
GH-131798: Type-propagate string/list/tuple slices (GH-134671)
2025-06-07 14:08:44 -07:00
Tomas R.
46151648ca
GH-131798: Optimize away type(x) in the JIT when the result is known (GH-135194)
2025-06-06 16:44:43 -07:00
Petr Viktorin
e413e26719
gh-134891: Add PyUnstable_Unicode_GET_CACHED_HASH (GH-134892)
2025-06-06 15:51:00 +02:00
Mark Shannon
b90ecea9e6
GH-132554: Fix tier2 FOR_ITER implementation and optimizations (GH-135137)
2025-06-05 18:53:57 +01:00
Victor Stinner
f49a07b531
gh-133968: Add PyUnicodeWriter_WriteASCII() function ( #133973 )
...
Replace most PyUnicodeWriter_WriteUTF8() calls with
PyUnicodeWriter_WriteASCII().
Unrelated change to please the linter: remove an unused
import in test_ctypes.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-05-29 14:54:30 +00:00
Mark Shannon
9fbd66a93d
GH-133912: Fix PyObject_GenericSetDict to handle inline values (GH-134725)
2025-05-28 19:03:41 +01:00
Serhiy Storchaka
bac3fcba5b
gh-108512: Add and use new replacements for PySys_GetObject() (GH-111035)
...
Add functions PySys_GetAttr(), PySys_GetAttrString(),
PySys_GetOptionalAttr() and PySys_GetOptionalAttrString().
2025-05-28 20:11:09 +03:00
Hugo van Kemenade
328a778db8
gh-134357: Remove unused imports in tests ( #134340 )
2025-05-25 20:09:02 +00:00
Serhiy Storchaka
77eade39f9
gh-134578: Mark more slow tests (GH-134579)
2025-05-23 19:59:10 +03:00
Tomas R.
484e00379b
GH-131798: Optimize away isinstance calls in the JIT (GH-134369)
2025-05-22 12:52:47 -04:00
Brandt Bucher
ec736e7dae
GH-131798: Optimize cached class attributes and methods in the JIT (GH-134403)
2025-05-22 11:15:03 -04:00
Nadeshiko Manju
8c5e5557c6
GH-131798: Turn _LOAD_SMALL_INT into _LOAD_CONST_INLINE_BORROW in the JIT (GH-134406)
2025-05-22 09:54:57 -04:00
Sergey Miryanov
7309eb60c0
gh-131357: Add some extra tests for empty bytes and bytearray ( #134458 )
2025-05-22 09:01:46 +02:00
Brandt Bucher
2f0570caf4
GH-131798: Narrow types more aggressively in the JIT (GH-134373)
2025-05-20 18:09:51 -04:00
Nadeshiko Manju
e1c0c451a2
GH-131798: Narrow the return type of _GET_LEN to int (GH-133345)
2025-05-20 18:02:50 -04:00