From 7c4765357aaf22c42250c91a5506eea6a0616e4a Mon Sep 17 00:00:00 2001 From: Alan Du Date: Wed, 13 Dec 2017 17:25:32 -0500 Subject: [PATCH] Make requests.Response.iter_content allow None (#1784) * Make requests.Response.iter_content allow None According to the docstring: > chunk_size must be of type int or None * Combine and alphabetize import statement --- third_party/2and3/requests/models.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/third_party/2and3/requests/models.pyi b/third_party/2and3/requests/models.pyi index b3f904008..cdd8ab296 100644 --- a/third_party/2and3/requests/models.pyi +++ b/third_party/2and3/requests/models.pyi @@ -1,6 +1,7 @@ # Stubs for requests.models (Python 3) -from typing import Any, List, MutableMapping, Iterator, Dict, Text +from typing import (Any, Dict, Iterator, List, MutableMapping, Optional, Text, + Union) import datetime import types @@ -18,7 +19,6 @@ from . import utils from . import compat from . import status_codes -from typing import Optional, Union default_hooks = hooks.default_hooks CaseInsensitiveDict = structures.CaseInsensitiveDict @@ -125,7 +125,7 @@ class Response: def is_permanent_redirect(self) -> bool: ... @property def apparent_encoding(self) -> str: ... - def iter_content(self, chunk_size: int = ..., + def iter_content(self, chunk_size: Optional[int] = ..., decode_unicode: bool = ...) -> Iterator[Any]: ... def iter_lines(self, chunk_size=..., decode_unicode=..., delimiter=...): ... @property