---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/invalid/expressions/yield_from/unparenthesized.py
snapshot_kind: text
---
## AST

```
Module(
    ModModule {
        range: 0..192,
        body: [
            Expr(
                StmtExpr {
                    range: 35..47,
                    value: YieldFrom(
                        ExprYieldFrom {
                            range: 35..47,
                            value: Name(
                                ExprName {
                                    range: 46..47,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 51..52,
                    value: NumberLiteral(
                        ExprNumberLiteral {
                            range: 51..52,
                            value: Int(
                                1,
                            ),
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 89..104,
                    value: YieldFrom(
                        ExprYieldFrom {
                            range: 89..104,
                            value: Tuple(
                                ExprTuple {
                                    range: 100..104,
                                    elts: [
                                        Name(
                                            ExprName {
                                                range: 100..101,
                                                id: Name("x"),
                                                ctx: Load,
                                            },
                                        ),
                                        Name(
                                            ExprName {
                                                range: 103..104,
                                                id: Name("y"),
                                                ctx: Load,
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                    parenthesized: false,
                                },
                            ),
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    range: 168..192,
                    value: YieldFrom(
                        ExprYieldFrom {
                            range: 168..192,
                            value: Tuple(
                                ExprTuple {
                                    range: 179..192,
                                    elts: [
                                        Name(
                                            ExprName {
                                                range: 180..181,
                                                id: Name("x"),
                                                ctx: Load,
                                            },
                                        ),
                                        Starred(
                                            ExprStarred {
                                                range: 183..191,
                                                value: BoolOp(
                                                    ExprBoolOp {
                                                        range: 184..191,
                                                        op: And,
                                                        values: [
                                                            Name(
                                                                ExprName {
                                                                    range: 184..185,
                                                                    id: Name("x"),
                                                                    ctx: Load,
                                                                },
                                                            ),
                                                            Name(
                                                                ExprName {
                                                                    range: 190..191,
                                                                    id: Name("y"),
                                                                    ctx: Load,
                                                                },
                                                            ),
                                                        ],
                                                    },
                                                ),
                                                ctx: Load,
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                    parenthesized: true,
                                },
                            ),
                        },
                    ),
                },
            ),
        ],
    },
)
```
## Errors

  |
1 | # Unparenthesized named expression
2 | yield from x := 1
  |              ^^ Syntax Error: Expected a statement
3 | 
4 | # Unparenthesized tuple expression
  |


  |
4 | # Unparenthesized tuple expression
5 | yield from x, y
  |            ^^^^ Syntax Error: Unparenthesized tuple expression cannot be used here
6 | 
7 | # This is a tuple expression parsing
  |


  |
7 | # This is a tuple expression parsing
8 | #          vvvvvvvvvvvvv
9 | yield from (x, *x and y)
  |                 ^^^^^^^ Syntax Error: Boolean expression cannot be used here
  |
