From 51550a8e875d7b3a3be50146f587137ed56ebe0c Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 29 Jul 2026 00:28:09 -0400 Subject: [PATCH] perf: format HexBytes repr without intermediate string --- hexbytes/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hexbytes/main.py b/hexbytes/main.py index b0c8f37..89a2ad3 100644 --- a/hexbytes/main.py +++ b/hexbytes/main.py @@ -51,7 +51,7 @@ def __getitem__( # noqa: F811 return result def __repr__(self) -> str: - return f"HexBytes({'0x' + self.hex()!r})" + return f"HexBytes('0x{self.hex()}')" def to_0x_hex(self) -> str: """