Skip to content

Commit 618267c

Browse files
nejchJohnVillalovos
authored andcommitted
chore: don't explicitly pass args to super()
1 parent e8031f4 commit 618267c

File tree

7 files changed

+11
-13
lines changed

7 files changed

+11
-13
lines changed

docs/ext/docstrings.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ def _build_doc(self, tmpl, **kwargs):
4848
def __init__(
4949
self, docstring, config=None, app=None, what="", name="", obj=None, options=None
5050
):
51-
super(GitlabDocstring, self).__init__(
52-
docstring, config, app, what, name, obj, options
53-
)
51+
super().__init__(docstring, config, app, what, name, obj, options)
5452

5553
if name.startswith("gitlab.v4.objects") and name.endswith("Manager"):
5654
self._parsed_lines.extend(self._build_doc("manager_tmpl.j2", cls=self._obj))

gitlab/base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -167,21 +167,21 @@ def __eq__(self, other: object) -> bool:
167167
return NotImplemented
168168
if self.get_id() and other.get_id():
169169
return self.get_id() == other.get_id()
170-
return super(RESTObject, self) == other
170+
return super() == other
171171

172172
def __ne__(self, other: object) -> bool:
173173
if not isinstance(other, RESTObject):
174174
return NotImplemented
175175
if self.get_id() and other.get_id():
176176
return self.get_id() != other.get_id()
177-
return super(RESTObject, self) != other
177+
return super() != other
178178

179179
def __dir__(self) -> Iterable[str]:
180-
return set(self.attributes).union(super(RESTObject, self).__dir__())
180+
return set(self.attributes).union(super().__dir__())
181181

182182
def __hash__(self) -> int:
183183
if not self.get_id():
184-
return super(RESTObject, self).__hash__()
184+
return super().__hash__()
185185
return hash(self.get_id())
186186

187187
def _create_managers(self) -> None:

gitlab/v4/objects/appearance.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def update(
5656
"""
5757
new_data = new_data or {}
5858
data = new_data.copy()
59-
return super(ApplicationAppearanceManager, self).update(id, data, **kwargs)
59+
return super().update(id, data, **kwargs)
6060

6161
def get(
6262
self, id: Optional[Union[int, str]] = None, **kwargs: Any

gitlab/v4/objects/files.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def save( # type: ignore
5757
self.branch = branch
5858
self.commit_message = commit_message
5959
self.file_path = utils.EncodedId(self.file_path)
60-
super(ProjectFile, self).save(**kwargs)
60+
super().save(**kwargs)
6161

6262
@exc.on_http_error(exc.GitlabDeleteError)
6363
# NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore

gitlab/v4/objects/keys.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get(
2121
self, id: Optional[Union[int, str]] = None, lazy: bool = False, **kwargs: Any
2222
) -> Key:
2323
if id is not None:
24-
return cast(Key, super(KeyManager, self).get(id, lazy=lazy, **kwargs))
24+
return cast(Key, super().get(id, lazy=lazy, **kwargs))
2525

2626
if "fingerprint" not in kwargs:
2727
raise AttributeError("Missing attribute: id or fingerprint")

gitlab/v4/objects/services.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def get(
282282
"""
283283
obj = cast(
284284
ProjectService,
285-
super(ProjectServiceManager, self).get(id, lazy=lazy, **kwargs),
285+
super().get(id, lazy=lazy, **kwargs),
286286
)
287287
obj.id = id
288288
return obj
@@ -308,7 +308,7 @@ def update(
308308
GitlabUpdateError: If the server cannot perform the request
309309
"""
310310
new_data = new_data or {}
311-
result = super(ProjectServiceManager, self).update(id, new_data, **kwargs)
311+
result = super().update(id, new_data, **kwargs)
312312
self.id = id
313313
return result
314314

gitlab/v4/objects/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def update(
113113
data = new_data.copy()
114114
if "domain_whitelist" in data and data["domain_whitelist"] is None:
115115
data.pop("domain_whitelist")
116-
return super(ApplicationSettingsManager, self).update(id, data, **kwargs)
116+
return super().update(id, data, **kwargs)
117117

118118
def get(
119119
self, id: Optional[Union[int, str]] = None, **kwargs: Any

0 commit comments

Comments
 (0)