---
source: crates/ruff_python_parser/tests/fixtures.rs
input_file: crates/ruff_python_parser/resources/inline/ok/param_with_default.py
---
## AST

```
Module(
    ModModule {
        node_index: AtomicNodeIndex(..),
        range: 0..111,
        body: [
            FunctionDef(
                StmtFunctionDef {
                    node_index: AtomicNodeIndex(..),
                    range: 0..27,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: Name("foo"),
                        range: 4..7,
                        node_index: AtomicNodeIndex(..),
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 7..22,
                        node_index: AtomicNodeIndex(
                            0,
                        ),
                        posonlyargs: [],
                        args: [
                            ParameterWithDefault {
                                range: 8..21,
                                node_index: AtomicNodeIndex(..),
                                parameter: Parameter {
                                    range: 8..9,
                                    node_index: AtomicNodeIndex(..),
                                    name: Identifier {
                                        id: Name("x"),
                                        range: 8..9,
                                        node_index: AtomicNodeIndex(..),
                                    },
                                    annotation: None,
                                },
                                default: Some(
                                    Lambda(
                                        ExprLambda {
                                            node_index: AtomicNodeIndex(..),
                                            range: 10..21,
                                            parameters: Some(
                                                Parameters {
                                                    range: 17..18,
                                                    node_index: AtomicNodeIndex(
                                                        0,
                                                    ),
                                                    posonlyargs: [],
                                                    args: [
                                                        ParameterWithDefault {
                                                            range: 17..18,
                                                            node_index: AtomicNodeIndex(..),
                                                            parameter: Parameter {
                                                                range: 17..18,
                                                                node_index: AtomicNodeIndex(..),
                                                                name: Identifier {
                                                                    id: Name("y"),
                                                                    range: 17..18,
                                                                    node_index: AtomicNodeIndex(..),
                                                                },
                                                                annotation: None,
                                                            },
                                                            default: None,
                                                        },
                                                    ],
                                                    vararg: None,
                                                    kwonlyargs: [],
                                                    kwarg: None,
                                                },
                                            ),
                                            body: Name(
                                                ExprName {
                                                    node_index: AtomicNodeIndex(..),
                                                    range: 20..21,
                                                    id: Name("y"),
                                                    ctx: Load,
                                                },
                                            ),
                                        },
                                    ),
                                ),
                            },
                        ],
                        vararg: None,
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                node_index: AtomicNodeIndex(..),
                                range: 24..27,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        node_index: AtomicNodeIndex(..),
                                        range: 24..27,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            FunctionDef(
                StmtFunctionDef {
                    node_index: AtomicNodeIndex(..),
                    range: 28..60,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: Name("foo"),
                        range: 32..35,
                        node_index: AtomicNodeIndex(..),
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 35..55,
                        node_index: AtomicNodeIndex(
                            0,
                        ),
                        posonlyargs: [],
                        args: [
                            ParameterWithDefault {
                                range: 36..54,
                                node_index: AtomicNodeIndex(..),
                                parameter: Parameter {
                                    range: 36..37,
                                    node_index: AtomicNodeIndex(..),
                                    name: Identifier {
                                        id: Name("x"),
                                        range: 36..37,
                                        node_index: AtomicNodeIndex(..),
                                    },
                                    annotation: None,
                                },
                                default: Some(
                                    If(
                                        ExprIf {
                                            node_index: AtomicNodeIndex(..),
                                            range: 38..54,
                                            test: BooleanLiteral(
                                                ExprBooleanLiteral {
                                                    node_index: AtomicNodeIndex(..),
                                                    range: 43..47,
                                                    value: true,
                                                },
                                            ),
                                            body: NumberLiteral(
                                                ExprNumberLiteral {
                                                    node_index: AtomicNodeIndex(..),
                                                    range: 38..39,
                                                    value: Int(
                                                        1,
                                                    ),
                                                },
                                            ),
                                            orelse: NumberLiteral(
                                                ExprNumberLiteral {
                                                    node_index: AtomicNodeIndex(..),
                                                    range: 53..54,
                                                    value: Int(
                                                        2,
                                                    ),
                                                },
                                            ),
                                        },
                                    ),
                                ),
                            },
                        ],
                        vararg: None,
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                node_index: AtomicNodeIndex(..),
                                range: 57..60,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        node_index: AtomicNodeIndex(..),
                                        range: 57..60,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            FunctionDef(
                StmtFunctionDef {
                    node_index: AtomicNodeIndex(..),
                    range: 61..84,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: Name("foo"),
                        range: 65..68,
                        node_index: AtomicNodeIndex(..),
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 68..79,
                        node_index: AtomicNodeIndex(
                            0,
                        ),
                        posonlyargs: [],
                        args: [
                            ParameterWithDefault {
                                range: 69..78,
                                node_index: AtomicNodeIndex(..),
                                parameter: Parameter {
                                    range: 69..70,
                                    node_index: AtomicNodeIndex(..),
                                    name: Identifier {
                                        id: Name("x"),
                                        range: 69..70,
                                        node_index: AtomicNodeIndex(..),
                                    },
                                    annotation: None,
                                },
                                default: Some(
                                    Await(
                                        ExprAwait {
                                            node_index: AtomicNodeIndex(..),
                                            range: 71..78,
                                            value: Name(
                                                ExprName {
                                                    node_index: AtomicNodeIndex(..),
                                                    range: 77..78,
                                                    id: Name("y"),
                                                    ctx: Load,
                                                },
                                            ),
                                        },
                                    ),
                                ),
                            },
                        ],
                        vararg: None,
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                node_index: AtomicNodeIndex(..),
                                range: 81..84,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        node_index: AtomicNodeIndex(..),
                                        range: 81..84,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
            FunctionDef(
                StmtFunctionDef {
                    node_index: AtomicNodeIndex(..),
                    range: 85..110,
                    is_async: false,
                    decorator_list: [],
                    name: Identifier {
                        id: Name("foo"),
                        range: 89..92,
                        node_index: AtomicNodeIndex(..),
                    },
                    type_params: None,
                    parameters: Parameters {
                        range: 92..105,
                        node_index: AtomicNodeIndex(
                            0,
                        ),
                        posonlyargs: [],
                        args: [
                            ParameterWithDefault {
                                range: 93..104,
                                node_index: AtomicNodeIndex(..),
                                parameter: Parameter {
                                    range: 93..94,
                                    node_index: AtomicNodeIndex(..),
                                    name: Identifier {
                                        id: Name("x"),
                                        range: 93..94,
                                        node_index: AtomicNodeIndex(..),
                                    },
                                    annotation: None,
                                },
                                default: Some(
                                    Yield(
                                        ExprYield {
                                            node_index: AtomicNodeIndex(..),
                                            range: 96..103,
                                            value: Some(
                                                Name(
                                                    ExprName {
                                                        node_index: AtomicNodeIndex(..),
                                                        range: 102..103,
                                                        id: Name("y"),
                                                        ctx: Load,
                                                    },
                                                ),
                                            ),
                                        },
                                    ),
                                ),
                            },
                        ],
                        vararg: None,
                        kwonlyargs: [],
                        kwarg: None,
                    },
                    returns: None,
                    body: [
                        Expr(
                            StmtExpr {
                                node_index: AtomicNodeIndex(..),
                                range: 107..110,
                                value: EllipsisLiteral(
                                    ExprEllipsisLiteral {
                                        node_index: AtomicNodeIndex(..),
                                        range: 107..110,
                                    },
                                ),
                            },
                        ),
                    ],
                },
            ),
        ],
    },
)
```
