Skip to content

Commit 8837207

Browse files
chore: add and fix some type-hints in gitlab/client.py
Was able to figure out better type-hints for gitlab/client.py
1 parent b0d75d9 commit 8837207

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

gitlab/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ def http_list(
623623
query_data: Optional[Dict[str, Any]] = None,
624624
as_list=None,
625625
**kwargs,
626-
):
626+
) -> Union["GitlabList", List[Dict[str, Any]]]:
627627
"""Make a GET request to the Gitlab server for list-oriented queries.
628628
629629
Args:
@@ -772,7 +772,9 @@ def http_delete(self, path: str, **kwargs) -> requests.Response:
772772
return self.http_request("delete", path, **kwargs)
773773

774774
@gitlab.exceptions.on_http_error(gitlab.exceptions.GitlabSearchError)
775-
def search(self, scope: str, search: str, **kwargs) -> requests.Response:
775+
def search(
776+
self, scope: str, search: str, **kwargs
777+
) -> Union["GitlabList", List[Dict[str, Any]]]:
776778
"""Search GitLab resources matching the provided string.'
777779
778780
Args:
@@ -896,10 +898,10 @@ def __len__(self) -> int:
896898
return 0
897899
return int(self._total)
898900

899-
def __next__(self):
901+
def __next__(self) -> Dict[str, Any]:
900902
return self.next()
901903

902-
def next(self) -> "Gitlab":
904+
def next(self) -> Dict[str, Any]:
903905
try:
904906
item = self._data[self._current]
905907
self._current += 1

0 commit comments

Comments
 (0)