fix HttpResponse stubs by removing AnyStr

This commit is contained in:
Maxim Kurnikov
2019-02-22 03:22:11 +03:00
parent b686751f19
commit eaee3d390f

View File

@@ -1,7 +1,7 @@
import datetime
from io import BytesIO
from json import JSONEncoder
from typing import Any, AnyStr, Dict, Iterable, Iterator, List, Optional, Tuple, Type, Union, overload
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Type, Union, overload
from django.core.handlers.wsgi import WSGIRequest
from django.http.cookie import SimpleCookie
@@ -12,7 +12,7 @@ from django.urls import ResolverMatch
class BadHeaderError(ValueError): ...
class HttpResponseBase(Iterable[AnyStr]):
class HttpResponseBase(Iterable[Any]):
status_code: int = ...
cookies: SimpleCookie = ...
reason_phrase: str = ...
@@ -59,7 +59,7 @@ class HttpResponseBase(Iterable[AnyStr]):
def seekable(self) -> bool: ...
def writable(self) -> bool: ...
def writelines(self, lines: Iterable[object]): ...
def __iter__(self) -> Iterator[AnyStr]: ...
def __iter__(self) -> Iterator[Any]: ...
class HttpResponse(HttpResponseBase):
client: Client
@@ -86,10 +86,10 @@ class HttpResponse(HttpResponseBase):
def json(self) -> Dict[str, Any]: ...
class StreamingHttpResponse(HttpResponseBase):
content: AnyStr
streaming_content: Iterator[AnyStr]
def __init__(self, streaming_content: Iterable[AnyStr] = ..., *args: Any, **kwargs: Any) -> None: ...
def getvalue(self) -> AnyStr: ...
content: Any
streaming_content: Iterator[Any]
def __init__(self, streaming_content: Iterable[Any] = ..., *args: Any, **kwargs: Any) -> None: ...
def getvalue(self) -> Any: ...
class FileResponse(StreamingHttpResponse):
client: Client