From 907634fe4d0d30706656b8bc56260b5532613e62 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Fri, 26 Feb 2021 17:35:02 -0800 Subject: 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, ...] --- gitlab/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gitlab/utils.py') 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: -- cgit v1.2.1