From 566cca84c2c2517ec6aa38db048ca48bd00738a0 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 30 Nov 2023 12:52:19 -0500 Subject: [PATCH] chore(internal): replace string concatenation with f-strings (#263) --- src/anthropic/_utils/_utils.py | 2 +- tests/test_required_args.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anthropic/_utils/_utils.py b/src/anthropic/_utils/_utils.py index d2bfc91a..83f88cc3 100644 --- a/src/anthropic/_utils/_utils.py +++ b/src/anthropic/_utils/_utils.py @@ -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]: diff --git a/tests/test_required_args.py b/tests/test_required_args.py index c506e4ef..fc774314 100644 --- a/tests/test_required_args.py +++ b/tests/test_required_args.py @@ -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"