Skip to content

Commit

Permalink
Convert __repr__ from format strings to fstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Miauwkeru committed Oct 8, 2024
1 parent f3dc2f1 commit 76246db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flow/record/fieldtypes/net/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __str__(self) -> str:
return str(self.val)

def __repr__(self) -> str:
return "{}({!r})".format(self._type, str(self))
return f"{self._type}({str(self)!r})"

def __format__(self, spec: str) -> str:
if spec == "defang":
Expand Down Expand Up @@ -78,7 +78,7 @@ def __str__(self) -> str:
return str(self.val)

def __repr__(self) -> str:
return "{}({!r})".format(self._type, str(self))
return f"{self._type}({str(self)!r})"

def _pack(self) -> str:
return self.val.compressed
Expand Down

0 comments on commit 76246db

Please sign in to comment.