diff options
author | John L. Villalovos <john@sodarock.com> | 2021-02-26 17:35:02 -0800 |
---|---|---|
committer | John L. Villalovos <john@sodarock.com> | 2021-02-28 08:48:31 -0800 |
commit | 907634fe4d0d30706656b8bc56260b5532613e62 (patch) | |
tree | 364677392e08928753133128174d049ff2c8c41d /gitlab/utils.py | |
parent | d8b8a0a010b41465586dccf198582ae127a31530 (diff) | |
download | gitlab-907634fe4d0d30706656b8bc56260b5532613e62.tar.gz |
chore: disallow incomplete type defs
Don't allow a partially annotated function definition. Either none of
the function is annotated or all of it must be.
Update code to ensure no-more partially annotated functions.
Update gitlab/cli.py with better type-hints. Changed Tuple[Any, ...]
to Tuple[str, ...]
Diffstat (limited to 'gitlab/utils.py')
-rw-r--r-- | gitlab/utils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gitlab/utils.py b/gitlab/utils.py index 780cf90..987f1d3 100644 --- a/gitlab/utils.py +++ b/gitlab/utils.py @@ -22,7 +22,7 @@ import requests class _StdoutStream(object): - def __call__(self, chunk) -> None: + def __call__(self, chunk: Any) -> None: print(chunk) @@ -31,7 +31,7 @@ def response_content( streamed: bool, action: Optional[Callable], chunk_size: int, -): +) -> Optional[bytes]: if streamed is False: return response.content @@ -41,6 +41,7 @@ def response_content( for chunk in response.iter_content(chunk_size=chunk_size): if chunk: action(chunk) + return None def copy_dict(dest: Dict[str, Any], src: Dict[str, Any]) -> None: |