Title: Preserve channel argument conversion order by youknowdot · Pull Request #9651 · RustPython/RustPython · GitHub
Open Graph Title: Preserve channel argument conversion order by youknowdot · Pull Request #9651 · RustPython/RustPython
X Title: Preserve channel argument conversion order by youknowdot · Pull Request #9651 · RustPython/RustPython
Description: Summary Let the existing ArgSpec::parse_with callback retain converted values through FnMut. It remains monomorphized; no new parser or boxed callback is introduced. Reuse channel ID, integer, and truth-conversion results instead of invoking user-defined conversion methods a second time. This covers channel ID construction, close/release, list_interpreters, send, and send_buffer. Preserve CPython's legacy PyArg_ParseTupleAndKeywords conversion order, including conversion before later missing/duplicate/unknown-keyword errors. Move create/recv conversions into that same shared parser and convert release's force argument even though its value is ignored. Add five generic parser unit tests for mutable result retention, callback order, error precedence, and failure short-circuiting. No snippet tests were added. The source reference is CPython v3.15.0 _interpchannelsmodule.c. Unlike _interpqueues, these functions still use the legacy parser, so replacing it with ordinary FromArgs or moving every conversion after validation would change observable behavior. Original FuncArgs owners remain alive across conversions, and channel locks are taken only afterward. Validation cargo check -p rustpython-vm --lib --offline: passed. cargo check -p rustpython-vm --tests --features threading --offline: passed. cargo clippy -p rustpython-vm --lib --features threading --offline -- -D warnings: passed. cargo clippy -p rustpython-vm --tests --features threading --offline -- -D warnings: passed after fixing two iterator-style warnings in the new tests. Normal pre-commit hooks, standalone rustfmt checks, and git diff --check: passed. Independent source review checked the format strings, defaults, conversion and error ordering, retained object ownership, and lack of new boxing/allocation overhead. 21 CPython 3.15.0 reference cases confirmed single conversion, force conversion, parameter order, and legacy error precedence. These verify the reference behavior, not execution of the RustPython implementation. The new Rust tests were compiled but not executed locally. Full workspace/C API tests and RustPython test_interpreters.test_channels execution remain for hosted CI because the coordinated native-execution guard is unavailable. Existing timeout numeric-policy issues are outside this focused change; it does not claim complete channel conversion parity. AI assistance Implementation and validation were assisted by OpenAI Codex. Its exact model version is not exposed in this runtime. Summary by CodeRabbit Refactor Interpreter channel arguments are now validated and converted as they are processed. Existing defaults and downstream behavior are preserved. Argument checks run in parameter order and stop after a check fails. Missing-argument and extra-keyword errors are reported after checks for supplied values.
Open Graph Description: Summary Let the existing ArgSpec::parse_with callback retain converted values through FnMut. It remains monomorphized; no new parser or boxed callback is introduced. Reuse channel ID, integer, and...
X Description: Summary Let the existing ArgSpec::parse_with callback retain converted values through FnMut. It remains monomorphized; no new parser or boxed callback is introduced. Reuse channel ID, integer, and...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9651
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:7b9ca97e-5259-a8a2-e5dd-03ec834d4e78 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | BDD6:928E2:333833B:444C5E9:6B01F931 |
| html-safe-nonce | a30b309bf6dd7127bdc913fb7e4b6bde303ef627ac8656dcd883bf4c0370df4e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCREQ2OjkyOEUyOjMzMzgzM0I6NDQ0QzVFOTo2QjAxRjkzMSIsInZpc2l0b3JfaWQiOiIxNTE5NDA4MzA0MTA1ODQ3MDkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ab5b25c482e1279d289b20ce8ad9664b9eceb2b0e56df8d54d0d8957cb3c75a3 |
| hovercard-subject-tag | pull_request:5143285141 |
| 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/9651/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 Let the existing ArgSpec::parse_with callback retain converted values through FnMut. It remains monomorphized; no new parser or boxed callback is introduced. Reuse channel ID, integer, and... |
| 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