Repository navigation
Python 3.15 - #10732
Python 3.15#10732
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… and op_GET_ITER stack behavior
…TANT. Python 3.15 emits this opcode for literals like -1 as well as builtins, so generalize the byteflow tracer and interpreter beyond AssertionError.
Locate LOAD_CONST dynamically instead of assuming a fixed offset after RESUME, which overwrote CACHE and triggered a fatal interpreter error.
…nstead of __cached__)
…itional comprehensions
|
I ran |
There was a problem hiding this comment.
One version guard needs to be be brought into line.
And also the file:
docs/source/reference/support_tiers.rst
References the 3.14 free threaded build. I presume we want to indicate somehow that this also includes the 3/15 free threaded build, as I assume we wish to produce an artifact for those too?
See screenshot below:
Review-assisted by: Kimi K3 via kilo-cli
|
|
||
| def op_GET_ITER(self, state, inst): | ||
| value = state.pop() | ||
| if PYVERSION >= (3, 15): |
There was a problem hiding this comment.
| if PYVERSION >= (3, 15): | |
| if PYVERSION in ((3, 15), ): |
For consistency. The other version guards use this style.
There was a problem hiding this comment.
Please also change the else if and else parts, such that a NotImplementedError is raised.
sklam
left a comment
There was a problem hiding this comment.
I reviewed 0591e68. The changes are solid. I cannot find any case that is a problem.
Other notes:
NOT_TAKEN appears when any conditional branching opcode occur (after any POP_JUMP_IF_):
>>> def f(x):
... if x: return True
... else: return False
...
>>> import dis
>>> dis.dis(f)
1 RESUME 0
2 LOAD_FAST_BORROW 0 (x)
TO_BOOL
POP_JUMP_IF_FALSE 3 (to L1)
NOT_TAKEN
LOAD_COMMON_CONSTANT 9 (True)
RETURN_VALUE
3 L1: LOAD_COMMON_CONSTANT 10 (False)
RETURN_VALUE
|
I added CI changes needed for py3.15 here with 463b08b to 8408d58. With changes, osx-arm64 and linux-aarch64 build and tests do pass with py3.15.
|
This reverts commit f3bd7bd.
…sed on python3.13+
|
With f7e61d3, these test dependencies have been skipped on conda recipe test section for Python 3.15 until they are available - |
| #include "internal/pycore_call.h" | ||
| #include "cpython/code.h" | ||
|
|
||
| #elif (PY_MAJOR_VERSION >= 3) && (PY_MINOR_VERSION == 11) |
There was a problem hiding this comment.
Why is the code here moved ?
There was a problem hiding this comment.
Python 3.13+ (including 3.15) uses the public PyMonitoring APIs for sys-monitoring. (see: #10578)
The moved code are internal headers are only needed for the 3.12 invoke_monitoring() path, so they are now gated under the 3.12-only block. One of those headers also conflicted with the MSVC /std:c++20 change, which is why they were moved.
| ("3.13", "2.1"), | ||
| ("3.14", "2.3"), | ||
| ("3.15", "2.5"), | ||
| ) |
There was a problem hiding this comment.
Why no free-threaded (3.15t) on CI build/test matrix ?
There was a problem hiding this comment.
3.15t is intentionally omitted from this PR and will be added separately. From experiments on my fork (https://github.com/swap357/numba/actions/runs/33830492988/job/100892610519) looks like all build env dependencies might not have 3.15t (free-threading) support yet.
Replace index-based lookup with identity comparison (`is`) when searching for entries in the exception table. Additionally, add an assertion to verify depth consistency when merging adjacent entries.
esc
left a comment
There was a problem hiding this comment.
Ok, I gave this a final review and it's totally fine!
For the record, these are the 3.15 limitations, not addressed by this PR:
- No
3.15t(free threading) on wheels or condas - 3.15 condas have unmet dependencies because not all packages have been built out
- No 3.15 win-arm64 support just yet
We are merging this now to enable 3.15 on the bulk of our officially supported platforms with the goal of fixing up the rest in subsequent PRs.
Thank you @swap357 for the patches and thank you @sklam and @stuartarchibald for the additional reviews, feedback and suggestions. ❤️
|
FWIW: there was one CI failure on linux-64: github.com/numba/numba/actions/runs/33847524840/job/100943453103?pr=10732 From OOB conversations with @stuartarchibald and @swap357 this is most likely a latent bug that has existed for years. It's probably not 3.15 specific and should not block the merge of this PR. May need to open a new issue to track it |
there's a related issue here - #10563. |

This PR adds Python 3.15 support to Numba.
Co-Authored-By: Claude Sonnet 4.6