---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/valid/expressions/slice.py
---
## AST

```
Module(
    ModModule {
        node_index: AtomicNodeIndex(..),
        range: 0..211,
        body: [
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 23..27,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 23..27,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 23..24,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 25..26,
                                    lower: None,
                                    upper: None,
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 28..33,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 28..33,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 28..29,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 30..32,
                                    lower: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 30..31,
                                                value: Int(
                                                    1,
                                                ),
                                            },
                                        ),
                                    ),
                                    upper: None,
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 34..39,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 34..39,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 34..35,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 36..38,
                                    lower: None,
                                    upper: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 37..38,
                                                value: Int(
                                                    2,
                                                ),
                                            },
                                        ),
                                    ),
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 40..46,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 40..46,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 40..41,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 42..45,
                                    lower: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 42..43,
                                                value: Int(
                                                    1,
                                                ),
                                            },
                                        ),
                                    ),
                                    upper: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 44..45,
                                                value: Int(
                                                    2,
                                                ),
                                            },
                                        ),
                                    ),
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 47..52,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 47..52,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 47..48,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 49..51,
                                    lower: None,
                                    upper: None,
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 53..59,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 53..59,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 53..54,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 55..58,
                                    lower: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 55..56,
                                                value: Int(
                                                    1,
                                                ),
                                            },
                                        ),
                                    ),
                                    upper: None,
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 60..66,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 60..66,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 60..61,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 62..65,
                                    lower: None,
                                    upper: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 63..64,
                                                value: Int(
                                                    2,
                                                ),
                                            },
                                        ),
                                    ),
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 67..74,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 67..74,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 67..68,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 69..73,
                                    lower: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 69..70,
                                                value: Int(
                                                    1,
                                                ),
                                            },
                                        ),
                                    ),
                                    upper: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 71..72,
                                                value: Int(
                                                    2,
                                                ),
                                            },
                                        ),
                                    ),
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 75..81,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 75..81,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 75..76,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 77..80,
                                    lower: None,
                                    upper: None,
                                    step: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 79..80,
                                                value: Int(
                                                    3,
                                                ),
                                            },
                                        ),
                                    ),
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 82..89,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 82..89,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 82..83,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 84..88,
                                    lower: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 84..85,
                                                value: Int(
                                                    1,
                                                ),
                                            },
                                        ),
                                    ),
                                    upper: None,
                                    step: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 87..88,
                                                value: Int(
                                                    3,
                                                ),
                                            },
                                        ),
                                    ),
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 90..97,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 90..97,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 90..91,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 92..96,
                                    lower: None,
                                    upper: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 93..94,
                                                value: Int(
                                                    2,
                                                ),
                                            },
                                        ),
                                    ),
                                    step: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 95..96,
                                                value: Int(
                                                    3,
                                                ),
                                            },
                                        ),
                                    ),
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 98..106,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 98..106,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 98..99,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 100..105,
                                    lower: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 100..101,
                                                value: Int(
                                                    1,
                                                ),
                                            },
                                        ),
                                    ),
                                    upper: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 102..103,
                                                value: Int(
                                                    2,
                                                ),
                                            },
                                        ),
                                    ),
                                    step: Some(
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 104..105,
                                                value: Int(
                                                    3,
                                                ),
                                            },
                                        ),
                                    ),
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 127..136,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 127..136,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 127..128,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Named(
                                ExprNamed {
                                    node_index: AtomicNodeIndex(..),
                                    range: 129..135,
                                    target: Name(
                                        ExprName {
                                            node_index: AtomicNodeIndex(..),
                                            range: 129..130,
                                            id: Name("y"),
                                            ctx: Store,
                                        },
                                    ),
                                    value: NumberLiteral(
                                        ExprNumberLiteral {
                                            node_index: AtomicNodeIndex(..),
                                            range: 134..135,
                                            value: Int(
                                                2,
                                            ),
                                        },
                                    ),
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 137..149,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 137..149,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 137..138,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Slice(
                                ExprSlice {
                                    node_index: AtomicNodeIndex(..),
                                    range: 139..148,
                                    lower: Some(
                                        Named(
                                            ExprNamed {
                                                node_index: AtomicNodeIndex(..),
                                                range: 140..146,
                                                target: Name(
                                                    ExprName {
                                                        node_index: AtomicNodeIndex(..),
                                                        range: 140..141,
                                                        id: Name("y"),
                                                        ctx: Store,
                                                    },
                                                ),
                                                value: NumberLiteral(
                                                    ExprNumberLiteral {
                                                        node_index: AtomicNodeIndex(..),
                                                        range: 145..146,
                                                        value: Int(
                                                            2,
                                                        ),
                                                    },
                                                ),
                                            },
                                        ),
                                    ),
                                    upper: None,
                                    step: None,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 150..160,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 150..160,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 150..151,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Tuple(
                                ExprTuple {
                                    node_index: AtomicNodeIndex(..),
                                    range: 152..159,
                                    elts: [
                                        Named(
                                            ExprNamed {
                                                node_index: AtomicNodeIndex(..),
                                                range: 152..158,
                                                target: Name(
                                                    ExprName {
                                                        node_index: AtomicNodeIndex(..),
                                                        range: 152..153,
                                                        id: Name("y"),
                                                        ctx: Store,
                                                    },
                                                ),
                                                value: NumberLiteral(
                                                    ExprNumberLiteral {
                                                        node_index: AtomicNodeIndex(..),
                                                        range: 157..158,
                                                        value: Int(
                                                            2,
                                                        ),
                                                    },
                                                ),
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                    parenthesized: false,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
            Expr(
                StmtExpr {
                    node_index: AtomicNodeIndex(..),
                    range: 202..210,
                    value: Subscript(
                        ExprSubscript {
                            node_index: AtomicNodeIndex(..),
                            range: 202..210,
                            value: Name(
                                ExprName {
                                    node_index: AtomicNodeIndex(..),
                                    range: 202..203,
                                    id: Name("x"),
                                    ctx: Load,
                                },
                            ),
                            slice: Tuple(
                                ExprTuple {
                                    node_index: AtomicNodeIndex(..),
                                    range: 204..209,
                                    elts: [
                                        NumberLiteral(
                                            ExprNumberLiteral {
                                                node_index: AtomicNodeIndex(..),
                                                range: 204..205,
                                                value: Int(
                                                    1,
                                                ),
                                            },
                                        ),
                                        Slice(
                                            ExprSlice {
                                                node_index: AtomicNodeIndex(..),
                                                range: 206..208,
                                                lower: None,
                                                upper: Some(
                                                    NumberLiteral(
                                                        ExprNumberLiteral {
                                                            node_index: AtomicNodeIndex(..),
                                                            range: 207..208,
                                                            value: Int(
                                                                2,
                                                            ),
                                                        },
                                                    ),
                                                ),
                                                step: None,
                                            },
                                        ),
                                    ],
                                    ctx: Load,
                                    parenthesized: false,
                                },
                            ),
                            ctx: Load,
                        },
                    ),
                },
            ),
        ],
    },
)
```
