Skip to content

Commit

Permalink
chore(internal): replace string concatenation with f-strings (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Nov 30, 2023
1 parent 4ff1a6b commit 7c920a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/finch/_utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> s

def quote(string: str) -> str:
"""Add single quotation marks around the given string. Does *not* do any escaping."""
return "'" + string + "'"
return f"'{string}'"


def required_args(*variants: Sequence[str]) -> Callable[[CallableT], CallableT]:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_required_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def foo(*, a: str | None = None) -> str | None:
def test_multiple_params() -> None:
@required_args(["a", "b", "c"])
def foo(a: str = "", *, b: str = "", c: str = "") -> str | None:
return a + " " + b + " " + c
return f"{a} {b} {c}"

assert foo(a="a", b="b", c="c") == "a b c"

Expand Down

0 comments on commit 7c920a3

Please sign in to comment.