more fixes for django stubs, first attempt for a plugin

This commit is contained in:
Maxim Kurnikov
2018-10-12 01:56:25 +03:00
parent b93f589cff
commit 2cdefc4662
11 changed files with 273 additions and 165 deletions

View File

@@ -1,3 +1,4 @@
from io import BufferedReader, StringIO
from typing import Any, Iterator, Optional, Union
from django.core.files.utils import FileProxyMixin
@@ -5,7 +6,7 @@ from django.core.files.utils import FileProxyMixin
class File(FileProxyMixin):
DEFAULT_CHUNK_SIZE: Any = ...
file: _io.BufferedReader = ...
file: BufferedReader = ...
name: str = ...
mode: str = ...
def __init__(self, file: Any, name: Optional[str] = ...) -> None: ...
@@ -14,7 +15,7 @@ class File(FileProxyMixin):
def size(self) -> int: ...
def chunks(
self, chunk_size: Optional[int] = ...
) -> Iterator[Union[bytes, str]]: ...
) -> Iterator[Union[bytes, bytearray]]: ...
def multiple_chunks(self, chunk_size: Optional[Any] = ...): ...
def __iter__(self) -> Iterator[Union[bytes, str]]: ...
def __enter__(self) -> File: ...
@@ -23,7 +24,7 @@ class File(FileProxyMixin):
def close(self) -> None: ...
class ContentFile(File):
file: _io.StringIO
file: StringIO
name: None
size: Any = ...
def __init__(