Skip to content

Commit 3e01345

Browse files
authoredDec 1, 2024··
STY: Use f-strings (#2973)
Use f-strings in two methods of class PdfObject.
1 parent a1d5de1 commit 3e01345

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed
 

‎pypdf/generic/_base.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,12 @@ def hash_bin(self) -> int:
7272
)
7373

7474
def hash_value_data(self) -> bytes:
75-
return ("%s" % self).encode()
75+
return f"{self}".encode()
7676

7777
def hash_value(self) -> bytes:
7878
return (
79-
"%s:%s"
80-
% (
81-
self.__class__.__name__,
82-
self.hash_func(self.hash_value_data()).hexdigest(),
83-
)
79+
f"{self.__class__.__name__}:"
80+
f"{self.hash_func(self.hash_value_data()).hexdigest()}"
8481
).encode()
8582

8683
def replicate(

0 commit comments

Comments
 (0)
Please sign in to comment.