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

```
Module(
    ModModule {
        range: 0..200,
        body: [
            Expr(
                StmtExpr {
                    range: 84..93,
                    value: List(
                        ExprList {
                            range: 84..93,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        range: 86..88,
                                        value: Name(
                                            ExprName {
                                                range: 87..88,
                                                id: "x",
                                                ctx: Load,
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 91..92,
                                        id: "y",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 94..106,
                    value: List(
                        ExprList {
                            range: 94..106,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        range: 95..102,
                                        value: Compare(
                                            ExprCompare {
                                                range: 96..102,
                                                left: Name(
                                                    ExprName {
                                                        range: 96..97,
                                                        id: "x",
                                                        ctx: Load,
                                                    },
                                                ),
                                                ops: [
                                                    In,
                                                ],
                                                comparators: [
                                                    Name(
                                                        ExprName {
                                                            range: 101..102,
                                                            id: "y",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                ],
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 104..105,
                                        id: "z",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 107..118,
                    value: List(
                        ExprList {
                            range: 107..118,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        range: 108..114,
                                        value: UnaryOp(
                                            ExprUnaryOp {
                                                range: 109..114,
                                                op: Not,
                                                operand: Name(
                                                    ExprName {
                                                        range: 113..114,
                                                        id: "x",
                                                        ctx: Load,
                                                    },
                                                ),
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 116..117,
                                        id: "z",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 119..132,
                    value: List(
                        ExprList {
                            range: 119..132,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        range: 120..128,
                                        value: BoolOp(
                                            ExprBoolOp {
                                                range: 121..128,
                                                op: And,
                                                values: [
                                                    Name(
                                                        ExprName {
                                                            range: 121..122,
                                                            id: "x",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                    Name(
                                                        ExprName {
                                                            range: 127..128,
                                                            id: "y",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                ],
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 130..131,
                                        id: "z",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 133..145,
                    value: List(
                        ExprList {
                            range: 133..145,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        range: 134..141,
                                        value: BoolOp(
                                            ExprBoolOp {
                                                range: 135..141,
                                                op: Or,
                                                values: [
                                                    Name(
                                                        ExprName {
                                                            range: 135..136,
                                                            id: "x",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                    Name(
                                                        ExprName {
                                                            range: 140..141,
                                                            id: "y",
                                                            ctx: Load,
                                                        },
                                                    ),
                                                ],
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 143..144,
                                        id: "z",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 146..168,
                    value: List(
                        ExprList {
                            range: 146..168,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        range: 147..164,
                                        value: If(
                                            ExprIf {
                                                range: 148..164,
                                                test: BooleanLiteral(
                                                    ExprBooleanLiteral {
                                                        range: 153..157,
                                                        value: true,
                                                    },
                                                ),
                                                body: Name(
                                                    ExprName {
                                                        range: 148..149,
                                                        id: "x",
                                                        ctx: Load,
                                                    },
                                                ),
                                                orelse: Name(
                                                    ExprName {
                                                        range: 163..164,
                                                        id: "y",
                                                        ctx: Load,
                                                    },
                                                ),
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 166..167,
                                        id: "z",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 169..186,
                    value: List(
                        ExprList {
                            range: 169..186,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        range: 170..182,
                                        value: Lambda(
                                            ExprLambda {
                                                range: 171..182,
                                                parameters: Some(
                                                    Parameters {
                                                        range: 178..179,
                                                        posonlyargs: [],
                                                        args: [
                                                            ParameterWithDefault {
                                                                range: 178..179,
                                                                parameter: Parameter {
                                                                    range: 178..179,
                                                                    name: Identifier {
                                                                        id: "x",
                                                                        range: 178..179,
                                                                    },
                                                                    annotation: None,
                                                                },
                                                                default: None,
                                                            },
                                                        ],
                                                        vararg: None,
                                                        kwonlyargs: [],
                                                        kwarg: None,
                                                    },
                                                ),
                                                body: Name(
                                                    ExprName {
                                                        range: 181..182,
                                                        id: "x",
                                                        ctx: Load,
                                                    },
                                                ),
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 184..185,
                                        id: "z",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 187..199,
                    value: List(
                        ExprList {
                            range: 187..199,
                            elts: [
                                Starred(
                                    ExprStarred {
                                        range: 188..190,
                                        value: Name(
                                            ExprName {
                                                range: 189..190,
                                                id: "x",
                                                ctx: Load,
                                            },
                                        ),
                                        ctx: Load,
                                    },
                                ),
                                NumberLiteral(
                                    ExprNumberLiteral {
                                        range: 194..195,
                                        value: Int(
                                            2,
                                        ),
                                    },
                                ),
                                Name(
                                    ExprName {
                                        range: 197..198,
                                        id: "z",
                                        ctx: Load,
                                    },
                                ),
                            ],
                            ctx: Load,
                        },
                    ),
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | # For list expression, the minimum binding power of star expression is bitwise or.
2 | 
3 | [(*x), y]
  |   ^^ Syntax Error: Starred expression cannot be used here
4 | [*x in y, z]
5 | [*not x, z]
  |


  |
3 | [(*x), y]
4 | [*x in y, z]
  |   ^^^^^^ Syntax Error: Comparison expression cannot be used here
5 | [*not x, z]
6 | [*x and y, z]
  |


  |
3 | [(*x), y]
4 | [*x in y, z]
5 | [*not x, z]
  |   ^^^^^ Syntax Error: Boolean expression cannot be used here
6 | [*x and y, z]
7 | [*x or y, z]
  |


  |
4 | [*x in y, z]
5 | [*not x, z]
6 | [*x and y, z]
  |   ^^^^^^^ Syntax Error: Boolean expression cannot be used here
7 | [*x or y, z]
8 | [*x if True else y, z]
  |


  |
5 | [*not x, z]
6 | [*x and y, z]
7 | [*x or y, z]
  |   ^^^^^^ Syntax Error: Boolean expression cannot be used here
8 | [*x if True else y, z]
9 | [*lambda x: x, z]
  |


   |
 6 | [*x and y, z]
 7 | [*x or y, z]
 8 | [*x if True else y, z]
   |   ^^^^^^^^^^^^^^^^ Syntax Error: Conditional expression cannot be used here
 9 | [*lambda x: x, z]
10 | [*x := 2, z]
   |


   |
 7 | [*x or y, z]
 8 | [*x if True else y, z]
 9 | [*lambda x: x, z]
   |   ^^^^^^^^^^^ Syntax Error: Lambda expression cannot be used here
10 | [*x := 2, z]
   |


   |
 8 | [*x if True else y, z]
 9 | [*lambda x: x, z]
10 | [*x := 2, z]
   |     ^^ Syntax Error: Expected ',', found ':='
   |
