Skip to content

Commit

Permalink
fix: Fix type errors in expressions and value extractor, don't pass d…
Browse files Browse the repository at this point in the history
…uplicate arguments (found thanks to pysource-codegen)
  • Loading branch information
pawamoy committed Oct 6, 2023
1 parent eadaa56 commit 7e53288
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/griffe/agents/nodes/_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}}}"


Expand Down
8 changes: 7 additions & 1 deletion src/griffe/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))


Expand Down

0 comments on commit 7e53288

Please sign in to comment.