| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
PEP 758, accepted for Python 3.14, allows `except A, B:` and `except* A, B:` without parentheses when there is no `as` clause. The parser rejects both today, so a file using the new form fails to parse rather than producing a tree. `GenericList` already collapses a single element to itself and wraps the rest in a tuple, which is the shape CPython produces here, so this is one production per clause. The `as` form is untouched: PEP 758 keeps parentheses required there. python.rs is regenerated with lalrpop 0.20.0, the version that produced the file in tree. The diff is large because the state table renumbers.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: c697734a-0233-4598-b995-a48c370ff4be 📥 CommitsReviewing files that changed from the base of the PR and between 1834307 and 9b20906. ⛔ Files ignored due to path filters (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 Walkthrough WalkthroughThe grammar now accepts multiple comma-separated exception types without parentheses in except and except* clauses. A parser snapshot test validates both forms. ChangesUnparenthesized exception group parsing
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to 9b209 This localized parser change adds support for unparenthesized exception groups while preserving existing forms; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5 ✅ Passed checks (5 passed)
Explanation Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 🧪 Generate unit tests (beta)
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. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
|
Did you check https://github.com/astral-sh/ruff ? RustPython now uses Ruff's parser. |
Sorry, something went wrong.
|
Thank you for contributing. I will merge it as long as it pass test, but it is not related to RustPython anymore as @fanninpm said |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
What this is
PEP 758 landed in Python 3.14 and allows except A, B: and except* A, B: without parentheses, as long as there is no as clause. The parser rejects both today, so a file using the new form fails to parse rather than producing a tree.
I ran into it scanning Django projects: on one of them 6 files out of 496 failed to parse, all of them on except ValueError, OSError:.
The change
Two productions, one per clause. GenericList already collapses a single element to itself and wraps the rest in a tuple, which is the shape CPython produces here:
- <location:@L> "except" <typ:Test<"all">?> ":" <body:Suite> => { + <location:@L> "except" <typ:GenericList<Test<"all">>?> ":" <body:Suite> => {The as form is untouched. PEP 758 keeps parentheses required there, and so does the grammar after this.
No new LALR conflicts: lalrpop generates without complaint.
What I checked
cargo test is green, 183 tests. The new snapshot shows ExprTuple for both clauses, matching CPython.
About the diff size
python.rs is regenerated with lalrpop 0.20.0, the version that produced the file in tree, so the change is not mixed with a generator upgrade. It is still ~9.7k lines because the state table renumbers whenever the grammar changes. The hand-written part of this PR is the two productions above, a test and its snapshot.
Summary by CodeRabbit