Title: Align builtin behavior and atexit callbacks with CPython by youknowdot · Pull Request #9442 · RustPython/RustPython · GitHub
Open Graph Title: Align builtin behavior and atexit callbacks with CPython by youknowdot · Pull Request #9442 · RustPython/RustPython
X Title: Align builtin behavior and atexit callbacks with CPython by youknowdot · Pull Request #9442 · RustPython/RustPython
Description: Summary Match CPython 3.15's complex constructor routes: single-positional conversion versus real/imag components, including deprecation warnings and conversion/error priority. Warn before replacing a function's code with a different generator/coroutine kind, after validating its closure requirements and before mutation/JIT locking. Match float power's full special-value ordering: zero exponents, NaNs, infinite exponents/bases, signed zero, finite negative fractional bases, exact odd parity, and signed underflow. Preserve the complete atexit callback snapshot through execution, report SystemExit and continue to later callbacks, and clear the live registry afterward. Release callback entries in reverse order and outside the registry mutex. Retire the three corresponding expected-failure decorators through actual update_lib migrations. test_complex.py, test_funcattrs.py, and test_float.py match CPython d220409a13b77de7a6c30abe16ea90db01528edc exactly. The complex conversion helper retains its returned object through argument validation and releases it before the original-real capability check/warning. Other try_complex callers 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 OverflowError with RustPython's existing math range error text rather than CPython's errno-derived arguments/message; platform-libm diagnostic equivalence is not claimed. Validation Fresh scoped cargo check and strict cargo clippy -- -Dwarnings passed; one guarded native build passed. Combined protected native executable built from base 8c6c94b07174224517b6bf62abab202565382ea7 plus this branch’s complex-constructor, function-code-warning, and float-power native changes: SHA-256 4b4b55bfffd0ba5a691efb6cc8b14aea8ca70976846f7951d07e41dc427b344a. All 23 recorded source hashes verified before/after build; protected binary verified at runtime. Complex: eight unmodified canonical constructor/conversion methods and nine finite warning/order/identity oracles passed (17 total). Function assignment: full canonical test_invalid___code___assignment and four finite warning/error-order oracles passed (5 total). Float power: full unmodified canonical GeneralFloatCases.test_float_pow and four finite special-value/sign/error-priority oracle groups passed (5 total). The complete updater-generated method also passed separately. All 27 combined native tests and the generated-method check passed without skips or expected failures. Matching host CPython runs passed the corresponding 17 + 5 + 5 tests. Updater self-tests passed: 228 tests with PYTHONPATH=scripts. Applicable configured hooks passed, including rustfmt, Ruff, cspell, and redundant-patch checks; diff checks passed. 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 4fc9eca9fdbb8fa3860371489302783ce62d51d4 without changing its existing native or Lib updates. Fresh scoped check and strict Clippy passed. One completed guarded recovery build produced protected executable SHA-256 37e950d1aead31f11b49092c862f232bcf703a4acd940e1f888e6662e03cf04d; 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.GeneralTest methods 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.
Open Graph Description: Summary Match CPython 3.15's complex constructor routes: single-positional conversion versus real/imag components, including deprecation warnings and conversion/error priority. Warn before rep...
X Description: Summary Match CPython 3.15's complex constructor routes: single-positional conversion versus real/imag components, including deprecation warnings and conversion/error priority. Warn before...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9442
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:94efdd73-f141-8190-36e0-18e40f8b82ff |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9600:EA09B:3422D11:4523641:6B01F79C |
| html-safe-nonce | 420deea233f60b74bc71732f7c60e492911e7cfa9af1631b4c8702f5e1093c53 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjAwOkVBMDlCOjM0MjJEMTE6NDUyMzY0MTo2QjAxRjc5QyIsInZpc2l0b3JfaWQiOiI1MTIzNzI3MTkzNzA4NTU4MjM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1f332ee6b45de9c9747dcecd0252ae3a574d4bfd1e5c3db95e18dfaf72855cd9 |
| hovercard-subject-tag | pull_request:5054191293 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9442/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Summary Match CPython 3.15's complex constructor routes: single-positional conversion versus real/imag components, including deprecation warnings and conversion/error priority. Warn before rep... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width