mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 14:00:51 -05:00
## Summary Follow-up to #14371, this PR simplifies the visitor logic for list expressions to remove the state management. We just need to make sure that we visit the nested expressions using the `QuoteAnnotator` and not the `Generator`. This is similar to what's being done for binary expressions. As per the [grammar](https://typing.readthedocs.io/en/latest/spec/annotations.html#grammar-token-expression-grammar-annotation_expression), list expressions can be present which can contain other type expressions (`Callable`): ``` | <Callable> '[' <Concatenate> '[' (type_expression ',')+ (name | '...') ']' ',' type_expression ']' (where name must be a valid in-scope ParamSpec) | <Callable> '[' '[' maybe_unpacked (',' maybe_unpacked)* ']' ',' type_expression ']' ``` ## Test Plan `cargo insta test`