Skip to content

Commit

Permalink
chore: don't explicitly pass args to super()
Browse files Browse the repository at this point in the history
  • Loading branch information
nejch authored and JohnVillalovos committed Jan 23, 2022
1 parent e8031f4 commit 618267c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 13 deletions.
4 changes: 1 addition & 3 deletions docs/ext/docstrings.py
Expand Up @@ -48,9 +48,7 @@ def _build_doc(self, tmpl, **kwargs):
def __init__(
self, docstring, config=None, app=None, what="", name="", obj=None, options=None
):
super(GitlabDocstring, self).__init__(
docstring, config, app, what, name, obj, options
)
super().__init__(docstring, config, app, what, name, obj, options)

if name.startswith("gitlab.v4.objects") and name.endswith("Manager"):
self._parsed_lines.extend(self._build_doc("manager_tmpl.j2", cls=self._obj))
8 changes: 4 additions & 4 deletions gitlab/base.py
Expand Up @@ -167,21 +167,21 @@ def __eq__(self, other: object) -> bool:
return NotImplemented
if self.get_id() and other.get_id():
return self.get_id() == other.get_id()
return super(RESTObject, self) == other
return super() == other

def __ne__(self, other: object) -> bool:
if not isinstance(other, RESTObject):
return NotImplemented
if self.get_id() and other.get_id():
return self.get_id() != other.get_id()
return super(RESTObject, self) != other
return super() != other

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

def __hash__(self) -> int:
if not self.get_id():
return super(RESTObject, self).__hash__()
return super().__hash__()
return hash(self.get_id())

def _create_managers(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/appearance.py
Expand Up @@ -56,7 +56,7 @@ def update(
"""
new_data = new_data or {}
data = new_data.copy()
return super(ApplicationAppearanceManager, self).update(id, data, **kwargs)
return super().update(id, data, **kwargs)

def get(
self, id: Optional[Union[int, str]] = None, **kwargs: Any
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/files.py
Expand Up @@ -57,7 +57,7 @@ def save( # type: ignore
self.branch = branch
self.commit_message = commit_message
self.file_path = utils.EncodedId(self.file_path)
super(ProjectFile, self).save(**kwargs)
super().save(**kwargs)

@exc.on_http_error(exc.GitlabDeleteError)
# NOTE(jlvillal): Signature doesn't match DeleteMixin.delete() so ignore
Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/keys.py
Expand Up @@ -21,7 +21,7 @@ def get(
self, id: Optional[Union[int, str]] = None, lazy: bool = False, **kwargs: Any
) -> Key:
if id is not None:
return cast(Key, super(KeyManager, self).get(id, lazy=lazy, **kwargs))
return cast(Key, super().get(id, lazy=lazy, **kwargs))

if "fingerprint" not in kwargs:
raise AttributeError("Missing attribute: id or fingerprint")
Expand Down
4 changes: 2 additions & 2 deletions gitlab/v4/objects/services.py
Expand Up @@ -282,7 +282,7 @@ def get(
"""
obj = cast(
ProjectService,
super(ProjectServiceManager, self).get(id, lazy=lazy, **kwargs),
super().get(id, lazy=lazy, **kwargs),
)
obj.id = id
return obj
Expand All @@ -308,7 +308,7 @@ def update(
GitlabUpdateError: If the server cannot perform the request
"""
new_data = new_data or {}
result = super(ProjectServiceManager, self).update(id, new_data, **kwargs)
result = super().update(id, new_data, **kwargs)
self.id = id
return result

Expand Down
2 changes: 1 addition & 1 deletion gitlab/v4/objects/settings.py
Expand Up @@ -113,7 +113,7 @@ def update(
data = new_data.copy()
if "domain_whitelist" in data and data["domain_whitelist"] is None:
data.pop("domain_whitelist")
return super(ApplicationSettingsManager, self).update(id, data, **kwargs)
return super().update(id, data, **kwargs)

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

0 comments on commit 618267c

Please sign in to comment.