Title: Share exception group construction and filtering controls by youknowdot · Pull Request #9588 · RustPython/RustPython · GitHub
Open Graph Title: Share exception group construction and filtering controls by youknowdot · Pull Request #9588 · RustPython/RustPython
X Title: Share exception group construction and filtering controls by youknowdot · Pull Request #9588 · RustPython/RustPython
Description: Summary Group CPython 3.15 ExceptionGroup construction, representation and filtering controls in 370 changed lines in one production Rust file. Derive nonempty subgroups whenever the group itself does not match, including when every child matches. Preserve identity for a direct whole-group match. Share guarded internal recursion between subgroup and split instead of dispatching nested Python overrides. Keep derive dynamic. Match callable nonclasses before exception types and exact tuples, including empty tuples and callable tuple subclasses. Reuse FuncArgs for raw positional binding while retaining original argument owners. Preserve constructor/initializer keyword boundaries, sequence callback errors, exact tuple identity, exact list snapshots and unhinted subclass iteration. Reject dictionary sequence impostors and validate actual BaseException payloads before dynamic Exception classification. Render children before snapshotting the short class name and rendering the message. Preserve WTF-8 and custom cached sequence representations; release temporary old-args ownership before callbacks. Retain both derive-input lists through both derives and release matching input before rest input. Preserve result/input cleanup order when a second derive or its metadata copy fails. Preserve the shared derivation metadata helper: copy traceback, copy or clear cause/context, and independently copy sequence notes, releasing the source notes reference before assignment. Its existing Vec entry point remains available to other Rust callers. Fixes #9576. Resolved dependency #9600 merged into main on November 4, 2026. This branch normally merges main c91556b, which includes its lock-safe metadata setters (merge 6d30f20). Independent review confirmed that ancestry and the combined source. The former dependency hold is resolved; no history was rewritten. This change does not depend on unmerged #9719 helpers. Validation Reference source: CPython d220409a13b77de7a6c30abe16ea90db01528edc. Independent source review passed for constructor ordering, ownership, lock safety, recursion, callback order and preservation of the original metadata behavior. The pinned CPython oracle passed 26 checkpoints; five ownership traces were reproduced, one explicitly recording a pre-existing excluded payload-teardown difference. Additional repr ownership/UTF-8 diagnostics and seven independent checkpoints passed, including second-result metadata-failure cleanup. These are reference/source checks, not RustPython runtime execution. Final threaded cargo check passed in 1m05s; all-targets Clippy passed in 2m13s. All 12 baseline diagnostics match unchanged, with no warning suppressions. Ordinary commit hooks, rustfmt and git diff --check passed. The final ownership-explicit source revision was independently re-reviewed. No tests, Lib files, assertions, expected failures or workflows were changed. Native RustPython was not run because the required execution guard has not been verified. Full workspace/C-API suites, runtime differential tests and separate platform/feature graphs remain unrun. Hosted CI must validate this exact head, including test_exception_group. Limits Existing bad-message diagnostics (prefix, None spelling and pathological raw-byte UTF-8 truncation), subclass cannot-nest long-name truncation, cached-repr/original-source payload teardown order, generic tuple-conversion failure cleanup and except-star projection are not claimed fixed. Existing canonical tests cover related split and metadata behavior but do not isolate every scenario in #9576. AI-assisted contribution by OpenAI Codex; assistance is disclosed in commit trailers. Summary by CodeRabbit Bug Fixes Exception group filtering returns None for empty results and derives groups from matching exceptions. Derived groups preserve traceback, context, cause, and supported notes. Exception group creation validates exception sequences and their contents more consistently. Exception matching accepts callable conditions and exact tuples of exception types, including empty tuples. Error messages for invalid arguments are clearer, and displayed class names are safely truncated.
Open Graph Description: Summary Group CPython 3.15 ExceptionGroup construction, representation and filtering controls in 370 changed lines in one production Rust file. Derive nonempty subgroups whenever the group itself ...
X Description: Summary Group CPython 3.15 ExceptionGroup construction, representation and filtering controls in 370 changed lines in one production Rust file. Derive nonempty subgroups whenever the group itself ...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9588
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:771e1b4b-c8f3-bee8-1fab-3be715427198 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A4DA:1C94F:2C7DA57:39067C0:6B01FE76 |
| html-safe-nonce | 7a55cf81193be256e4ffbadd122f0f5b3e0c65b2e1d417dd4e845ad417382cc1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNERBOjFDOTRGOjJDN0RBNTc6MzkwNjdDMDo2QjAxRkU3NiIsInZpc2l0b3JfaWQiOiIxNzM5MTc4OTIwMTkzOTQ5MzAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 619457e91f8c21cef6b7024e72c457937d939f3f7262a2a0e50f80a3885898b8 |
| hovercard-subject-tag | pull_request:5136836137 |
| 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/9588/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 Group CPython 3.15 ExceptionGroup construction, representation and filtering controls in 370 changed lines in one production Rust file. Derive nonempty subgroups whenever the group itself ... |
| 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