Title: Match Element child assignment error order by youknowdot · Pull Request #9626 · RustPython/RustPython · GitHub
Open Graph Title: Match Element child assignment error order by youknowdot · Pull Request #9626 · RustPython/RustPython
X Title: Match Element child assignment error order by youknowdot · Pull Request #9626 · RustPython/RustPython
Description: Summary Check scalar Element child indices before validating replacement values in both mapping and sequence assignment slots. An out-of-range index raises IndexError even if the value is not an Element; a valid index with an invalid value still raises TypeError. For extended-slice assignment, report a replacement-length mismatch before an invalid item type. Release materialized items before constructing the mismatch error. Construct errors after releasing the element lock; successful assignments retain the existing single-lock path and type scan. Scope This aligns the observable validation order. It does not attempt full parity for capacity-allocation failures, iterable materialization details, or concurrent mutation. Validation Compared with CPython 3.15.0 element_setitem and element_ass_subscr. CPython 3.15 reproductions covered invalid scalar indices, direct PySequence_SetItem, and mismatched versus matched extended-slice lengths containing invalid items. Independent source review for all three commits and normal commit hooks (including rustfmt) passed. A standalone Rust compiler-only metadata check confirmed the slice branch-local borrow/drop pattern; this is not a RustPython build. RustPython was not built or executed locally. No tests were added or changed; hosted CI is expected to run existing ElementTree tests. Summary by CodeRabbit Bug Fixes Element assignment now reports invalid indices before validating replacement values for integer assignments. Extended-slice assignments now report length mismatches before invalid replacement values. For unit-step slices, invalid values are still reported before replacement. Sequence-based integer assignment follows the same index-first validation order.
Open Graph Description: Summary Check scalar Element child indices before validating replacement values in both mapping and sequence assignment slots. An out-of-range index raises IndexError even if the value is not an E...
X Description: Summary Check scalar Element child indices before validating replacement values in both mapping and sequence assignment slots. An out-of-range index raises IndexError even if the value is not an E...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9626
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:9bd7c7da-c80c-e05a-ce46-9daed76c48cd |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B68C:9E08E:538592:691914:6B02036D |
| html-safe-nonce | db7af427d8353bd0e4588e535b5361b130e2cd9064671ba941867e31efc18e4a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjhDOjlFMDhFOjUzODU5Mjo2OTE5MTQ6NkIwMjAzNkQiLCJ2aXNpdG9yX2lkIjoiOTg2OTQxNzU1NDkxNjIzNDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7d5c19ba6412f21f4a58db6b570078c6dceab62d77d63bd8435ac4419d9e6f81 |
| hovercard-subject-tag | pull_request:5138309481 |
| 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/9626/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 Check scalar Element child indices before validating replacement values in both mapping and sequence assignment slots. An out-of-range index raises IndexError even if the value is not an E... |
| 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 |
| 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