diff --git a/src/griffe/agents/nodes/_values.py b/src/griffe/agents/nodes/_values.py index 130f5af8..699276e6 100644 --- a/src/griffe/agents/nodes/_values.py +++ b/src/griffe/agents/nodes/_values.py @@ -121,7 +121,7 @@ def _extract_floordiv(node: ast.FloorDiv, **kwargs: Any) -> str: return "//" -def _extract_formatted(node: ast.FormattedValue, **kwargs: Any) -> str: +def _extract_formatted(node: ast.FormattedValue, *, in_formatted_str: bool = False, **kwargs: Any) -> str: return f"{{{_extract(node.value, in_formatted_str=True, **kwargs)}}}" diff --git a/src/griffe/expressions.py b/src/griffe/expressions.py index 351c5b47..6263ce48 100644 --- a/src/griffe/expressions.py +++ b/src/griffe/expressions.py @@ -840,7 +840,13 @@ def _build_dictcomp(node: ast.DictComp, parent: Module | Class, **kwargs: Any) - ) -def _build_formatted(node: ast.FormattedValue, parent: Module | Class, **kwargs: Any) -> Expr: +def _build_formatted( + node: ast.FormattedValue, + parent: Module | Class, + *, + in_formatted_str: bool = False, # noqa: ARG001 + **kwargs: Any, +) -> Expr: return ExprFormatted(_build(node.value, parent, in_formatted_str=True, **kwargs))