---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/parenthesized/generator.py
---
## AST

```
Module(
    ModModule {
        node_index: AtomicNodeIndex(..),
        range: 0..36,
        body: [
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 0..15,
                    value: Generator(
                        ExprGenerator {
                            node_index: AtomicNodeIndex(..),
                            range: 0..15,
                            elt: Starred(
                                ExprStarred {
                                    node_index: AtomicNodeIndex(..),
                                    range: 1..3,
                                    value: Name(
                                        ExprName {
                                            node_index: AtomicNodeIndex(..),
                                            range: 2..3,
                                            id: Name("x"),
                                            ctx: Load,
                                        },
                                    ),
                                    ctx: Load,
                                },
                            ),
                            generators: [
                                Comprehension {
                                    range: 4..14,
                                    node_index: AtomicNodeIndex(..),
                                    target: Name(
                                        ExprName {
                                            node_index: AtomicNodeIndex(..),
                                            range: 8..9,
                                            id: Name("x"),
                                            ctx: Store,
                                        },
                                    ),
                                    iter: Name(
                                        ExprName {
                                            node_index: AtomicNodeIndex(..),
                                            range: 13..14,
                                            id: Name("y"),
                                            ctx: Load,
                                        },
                                    ),
                                    ifs: [],
                                    is_async: false,
                                },
                            ],
                            parenthesized: true,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 16..24,
                    value: Tuple(
                        ExprTuple {
                            node_index: AtomicNodeIndex(..),
                            range: 16..24,
                            elts: [
                                Named(
                                    ExprNamed {
                                        node_index: AtomicNodeIndex(..),
                                        range: 17..23,
                                        target: Name(
                                            ExprName {
                                                node_index: AtomicNodeIndex(..),
                                                range: 17..18,
                                                id: Name("x"),
                                                ctx: Store,
                                            },
                                        ),
                                        value: NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 22..23,
                                                value: Int(
                                                    1,
                                                ),
                                            },
                                        ),
                                    },
                                ),
                            ],
                            ctx: Load,
                            parenthesized: true,
                        },
                    ),
                },
            ),
            For(
                StmtFor {
                    node_index: AtomicNodeIndex(..),
                    range: 25..35,
                    is_async: false,
                    target: Name(
                        ExprName {
                            node_index: AtomicNodeIndex(..),
                            range: 29..30,
                            id: Name("x"),
                            ctx: Store,
                        },
                    ),
                    iter: Name(
                        ExprName {
                            node_index: AtomicNodeIndex(..),
                            range: 34..35,
                            id: Name("y"),
                            ctx: Load,
                        },
                    ),
                    body: [],
                    orelse: [],
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | (*x for x in y)
  |  ^^ Syntax Error: Iterable unpacking cannot be used in a comprehension
2 | (x := 1, for x in y)
  |


  |
1 | (*x for x in y)
2 | (x := 1, for x in y)
  |          ^^^ Syntax Error: Expected ')', found 'for'
  |


  |
1 | (*x for x in y)
2 | (x := 1, for x in y)
  |                    ^ Syntax Error: Expected ':', found ')'
  |


  |
1 | (*x for x in y)
2 | (x := 1, for x in y)
  |                     ^ Syntax Error: Expected a statement
  |
