Support structural pattern matching in ASYNC103,104 and 91X#363
Support structural pattern matching in ASYNC103,104 and 91X#363jakkdl merged 5 commits intopython-trio:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request enhances support for structural pattern matching in asynchronous contexts for ASYNC103/104 and ASYNC91X while fixing issue #173. The changes include updates to several test files to cover new async pattern matching cases, autofix implementations with asynchronous checkpointing, and modifications to the flake8_async visitors for structural match handling.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/eval_files/async91x_py310.py | Adds async pattern matching test cases for structural matching scenarios |
| tests/eval_files/async103_104_py310.py | Introduces pattern matching tests for ASYNC103/ASYNC104 |
| tests/autofix_files/async91x_py310.py | Provides autofix support with added checkpointing in async matching cases |
| flake8_async/visitors/visitor91x.py | Adds MatchState and adjusts state handling for match constructs |
| flake8_async/visitors/visitor103_104.py | Implements match visitor logic for pattern matching in exception handlers |
| .pre-commit-config.yaml | Updates file exclusion regex to support py310 and py311 test files |
Files not reviewed (1)
- tests/autofix_files/async91x_py310.py.diff: Language not supported
Comments suppressed due to low confidence (2)
flake8_async/visitors/visitor91x.py:920
- [nitpick] Consider using explicit keyword arguments when instantiating MatchState (e.g., base_uncheckpointed_statements=self.uncheckpointed_statements.copy()) to improve clarity.
self.match_state = MatchState(self.uncheckpointed_statements.copy())
tests/eval_files/async103_104_py310.py:57
- [nitpick] The variable name 'blah' is ambiguous; consider renaming it to a more descriptive identifier.
case blah:
Zac-HD
left a comment
There was a problem hiding this comment.
Looks great! Let's merge tomorrow to match the release number to the month 😁
|
haha, I didn't expect a same-day review 😁 |
|
(definitely a good call this close to the line) |
fixes #173