Skip to content

Commit

Permalink
STY: Use f-strings (#2973)
Browse files Browse the repository at this point in the history
Use f-strings in two methods of class PdfObject.
  • Loading branch information
j-t-1 authored Dec 1, 2024
1 parent a1d5de1 commit 3e01345
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pypdf/generic/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,12 @@ def hash_bin(self) -> int:
)

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

def hash_value(self) -> bytes:
return (
"%s:%s"
% (
self.__class__.__name__,
self.hash_func(self.hash_value_data()).hexdigest(),
)
f"{self.__class__.__name__}:"
f"{self.hash_func(self.hash_value_data()).hexdigest()}"
).encode()

def replicate(
Expand Down

0 comments on commit 3e01345

Please sign in to comment.