summaryrefslogtreecommitdiff
path: root/gitlab/base.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-11-01 19:22:18 +0100
committerJohn Villalovos <john@sodarock.com>2021-11-05 20:45:01 -0700
commit7925c902d15f20abaecdb07af213f79dad91355b (patch)
tree4c6766bfac4965590570c1b22ec5a56918461e1c /gitlab/base.py
parentf51d9be224ab509a62efe05e9f8ffb561af62df5 (diff)
downloadgitlab-7925c902d15f20abaecdb07af213f79dad91355b.tar.gz
refactor: use f-strings for string formatting
Diffstat (limited to 'gitlab/base.py')
-rw-r--r--gitlab/base.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/gitlab/base.py b/gitlab/base.py
index a4a1ef9..85e7d70 100644
--- a/gitlab/base.py
+++ b/gitlab/base.py
@@ -115,17 +115,13 @@ class RESTObject(object):
def __str__(self) -> str:
data = self._attrs.copy()
data.update(self._updated_attrs)
- return "%s => %s" % (type(self), data)
+ return f"{type(self)} => {data}"
def __repr__(self) -> str:
if self._id_attr:
- return "<%s %s:%s>" % (
- self.__class__.__name__,
- self._id_attr,
- self.get_id(),
- )
+ return f"<{self.__class__.__name__} {self._id_attr}:{self.get_id()}>"
else:
- return "<%s>" % self.__class__.__name__
+ return f"<{self.__class__.__name__}>"
def __eq__(self, other: object) -> bool:
if not isinstance(other, RESTObject):