Repository navigation
Align builtin behavior and atexit callbacks with CPython - #9442
youknowone merged 3 commits into
Conversation
Preserve constructor conversion and warning priority, and validate code kinds before assignment. Retire two canonical test markers after focused native verification. Assisted-by: OpenAI Codex: model version unavailable
|
Caution Review failedThe pull request is closed. Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] test: cpython/Lib/test/test_complex.py dependencies: dependent tests: (no tests depend on complex) [x] test: cpython/Lib/test/test_funcattrs.py dependencies: dependent tests: (no tests depend on funcattrs) [x] test: cpython/Lib/test/test_float.py dependencies: dependent tests: (no tests depend on float) Legend:
|
Handle NaNs, infinities, signed zero, exact fractional exponents, and signed underflow before generic finite power. Retire the canonical float-power expected-failure marker through update_lib after native verification. Assisted-by: OpenAI Codex: model version unavailable
Merging this PR will not alter performance
Comparing Footnotes
|
Assisted-by: OpenAI Codex: model version unavailable
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
update_libmigrations.test_complex.py,test_funcattrs.py, andtest_float.pymatch CPythond220409a13b77de7a6c30abe16ea90db01528edcexactly.The complex conversion helper retains its returned object through argument validation and releases it before the original-real capability check/warning. Other
try_complexcallers retain their prior scalar conversion behavior. Existing signed-zero, exact-complex identity, closure, and JIT guards are preserved.The float helper deliberately overlaps #8624's partial float-power correction: its numeric negativity and exact fractional classification are subsumed by the complete CPython special-value ordering. This does not incorporate or modify that PR's separate JIT changes. Finite overflow still raises
OverflowErrorwith RustPython's existingmath range errortext rather than CPython's errno-derived arguments/message; platform-libm diagnostic equivalence is not claimed.Validation
cargo checkand strictcargo clippy -- -Dwarningspassed; one guarded native build passed.8c6c94b07174224517b6bf62abab202565382ea7plus this branch’s complex-constructor, function-code-warning, and float-power native changes: SHA-2564b4b55bfffd0ba5a691efb6cc8b14aea8ca70976846f7951d07e41dc427b344a. All 23 recorded source hashes verified before/after build; protected binary verified at runtime.test_invalid___code___assignmentand four finite warning/error-order oracles passed (5 total).GeneralFloatCases.test_float_powand four finite special-value/sign/error-priority oracle groups passed (5 total). The complete updater-generated method also passed separately.PYTHONPATH=scripts.This is focused constructor, code-assignment, and float-power compatibility evidence, not a claim that all arithmetic, JIT execution, or Python 3.15 behavior was tested. No full-module/workspace/CAPI, concurrency, crash, GC, profiler, or stress suites were run for this follow-up.
Atexit follow-up and combined validation
The callback-only follow-up is applied to head
4fc9eca9fdbb8fa3860371489302783ce62d51d4without changing its existing native or Lib updates. Fresh scoped check and strict Clippy passed. One completed guarded recovery build produced protected executable SHA-25637e950d1aead31f11b49092c862f232bcf703a4acd940e1f888e6662e03cf04d; all 607 native inputs, retained source timestamps, compiler artifact provenance and 12 runtime inputs were verified.All 36 tests passed on that same combined executable: the 17 complex, 5 function-assignment and 5 float cases above, plus eight unchanged canonical
test._test_atexit.GeneralTestmethods and one bounded ordinary Python SystemExit-continuation check. Exact counts were enforced with no skips or expected failures. Earlier interrupted builds have unknown outcomes and supply no success evidence.This does not implement CPython's repeated finalization quiescence loop, change atexit Lib files, retire atexit markers or enable its new threading tests. Existing callback-entry field destruction layout and low-memory behavior are not asserted identical. No concurrency, GC, destructor-reentry, process-shutdown, profiler or stress tests were executed. The finalization/TLS changes owned by #8939 and #8944 remain separate; this patch does not import or modify them.
AI assistance
OpenAI Codex assisted with implementation, source review, validation, and this description.