mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
Remove a few files from the pytype blacklist. (#1628)
Fixes the following issues: * Literals rather than ... for default values * None rather than ... for default value of typed variable * Literals rather than ... # type for top level constants * # Foo rather than # type: Foo * return value of init not set to None
This commit is contained in:
committed by
Matthias Kramm
parent
d14272a14f
commit
d389ef3d85
@@ -42,8 +42,7 @@ if sys.version_info >= (3, 3):
|
||||
def header_source_parse(self, sourcelines: List[str]) -> str: ...
|
||||
def header_store_parse(self, name: str,
|
||||
value: str) -> Tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, # type: ignore
|
||||
value: str) -> Union[str, Header]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> Union[str, Header]: ... # type: ignore
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
from typing import Any
|
||||
from typing import Any, Optional
|
||||
import _compression
|
||||
|
||||
def open(filename, mode='', compresslevel=9, encoding=None, errors=None, newline=None): ...
|
||||
def open(filename, mode: str = ..., compresslevel: int = ..., encoding=None, errors=None, newline=None): ...
|
||||
|
||||
class _PaddedFile:
|
||||
file = ... # type: Any
|
||||
def __init__(self, f, prepend=b''): ...
|
||||
def __init__(self, f, prepend: bytes = ...) -> None: ...
|
||||
def read(self, size): ...
|
||||
def prepend(self, prepend=b''): ...
|
||||
def prepend(self, prepend: bytes = ...): ...
|
||||
def seek(self, off): ...
|
||||
def seekable(self): ...
|
||||
|
||||
@@ -17,15 +17,15 @@ class GzipFile(_compression.BaseStream):
|
||||
name = ... # type: Any
|
||||
compress = ... # type: Any
|
||||
fileobj = ... # type: Any
|
||||
def __init__(self, filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None): ...
|
||||
def __init__(self, filename=None, mode=None, compresslevel: int = ..., fileobj=None, mtime=None) -> None: ...
|
||||
@property
|
||||
def filename(self): ...
|
||||
@property
|
||||
def mtime(self): ...
|
||||
crc = ... # type: Any
|
||||
def write(self, data): ...
|
||||
def read(self, size=-1): ...
|
||||
def read1(self, size=-1): ...
|
||||
def read(self, size: Optional[int] = ...): ...
|
||||
def read1(self, size: int = ...): ...
|
||||
def peek(self, n): ...
|
||||
@property
|
||||
def closed(self): ...
|
||||
@@ -37,11 +37,11 @@ class GzipFile(_compression.BaseStream):
|
||||
def writable(self): ...
|
||||
def seekable(self): ...
|
||||
def seek(self, offset, whence=...): ...
|
||||
def readline(self, size=-1): ...
|
||||
def readline(self, size: int = ...): ...
|
||||
|
||||
class _GzipReader(_compression.DecompressReader):
|
||||
def __init__(self, fp): ...
|
||||
def read(self, size=-1): ...
|
||||
def __init__(self, fp) -> None: ...
|
||||
def read(self, size: int = ...): ...
|
||||
|
||||
def compress(data, compresslevel=9): ...
|
||||
def compress(data, compresslevel: int = ...): ...
|
||||
def decompress(data): ...
|
||||
|
||||
@@ -11,12 +11,12 @@ if sys.version_info >= (3, 5):
|
||||
def __init__(self, msg: str, doc: str, pos: int) -> None: ...
|
||||
|
||||
class JSONDecoder:
|
||||
object_hook = None # type: Callable[[Dict[str, Any]], Any]
|
||||
parse_float = ... # Callable[[str], Any]
|
||||
parse_int = ... # Callable[[str], Any]
|
||||
object_hook = ... # type: Callable[[Dict[str, Any]], Any]
|
||||
parse_float = ... # type: Callable[[str], Any]
|
||||
parse_int = ... # type: Callable[[str], Any]
|
||||
parse_constant = ... # Callable[[str], Any]
|
||||
strict = ... # type: bool
|
||||
object_pairs_hook = None # type: Callable[[List[Tuple[str, Any]]], Any]
|
||||
object_pairs_hook = ... # type: Callable[[List[Tuple[str, Any]]], Any]
|
||||
|
||||
def __init__(self, object_hook: Optional[Callable[[Dict[str, Any]], Any]] = None,
|
||||
parse_float: Optional[Callable[[str], Any]] = None,
|
||||
|
||||
@@ -9,7 +9,7 @@ class JSONEncoder:
|
||||
check_circular = ... # type: bool
|
||||
allow_nan = ... # type: bool
|
||||
sort_keys = ... # type: bool
|
||||
indent = None # type: int
|
||||
indent = ... # type: int
|
||||
|
||||
def __init__(self, skipkeys: bool = ..., ensure_ascii: bool = ...,
|
||||
check_circular: bool = ..., allow_nan: bool = ..., sort_keys: bool = ...,
|
||||
|
||||
@@ -57,12 +57,12 @@ class Misc:
|
||||
def tk_bisque(self): ...
|
||||
def tk_setPalette(self, *args, **kw): ...
|
||||
def tk_menuBar(self, *args): ...
|
||||
def wait_variable(self, name=''): ...
|
||||
def wait_variable(self, name: str = ...): ...
|
||||
waitvar = ... # type: Any
|
||||
def wait_window(self, window=None): ...
|
||||
def wait_visibility(self, window=None): ...
|
||||
def setvar(self, name='', value=''): ...
|
||||
def getvar(self, name=''): ...
|
||||
def setvar(self, name: str = ..., value: str = ...): ...
|
||||
def getvar(self, name: str = ...): ...
|
||||
def getint(self, s): ...
|
||||
def getdouble(self, s): ...
|
||||
def getboolean(self, s): ...
|
||||
@@ -278,14 +278,14 @@ class Tk(Misc, Wm):
|
||||
master = ... # type: Any
|
||||
children = ... # type: Any
|
||||
tk = ... # type: Any
|
||||
def __init__(self, screenName=None, baseName=None, className='', useTk=1, sync=0, use=None): ...
|
||||
def __init__(self, screenName=None, baseName=None, className: str = ..., useTk=1, sync=0, use=None) -> None: ...
|
||||
def loadtk(self): ...
|
||||
def destroy(self): ...
|
||||
def readprofile(self, baseName, className): ...
|
||||
def report_callback_exception(self, exc, val, tb): ...
|
||||
def __getattr__(self, attr): ...
|
||||
|
||||
def Tcl(screenName=None, baseName=None, className='', useTk=0): ...
|
||||
def Tcl(screenName=None, baseName=None, className: str = ..., useTk=0): ...
|
||||
|
||||
class Pack:
|
||||
def pack_configure(self, cnf=..., **kw): ...
|
||||
@@ -461,7 +461,7 @@ class Listbox(Widget, XView, YView):
|
||||
|
||||
class Menu(Widget):
|
||||
def __init__(self, master=None, cnf=..., **kw): ...
|
||||
def tk_popup(self, x, y, entry=''): ...
|
||||
def tk_popup(self, x, y, entry: str = ...): ...
|
||||
def tk_bindForTraversal(self): ...
|
||||
def activate(self, index): ...
|
||||
def add(self, itemType, cnf=..., **kw): ...
|
||||
@@ -603,8 +603,8 @@ class PhotoImage(Image):
|
||||
def cget(self, option): ...
|
||||
def __getitem__(self, key): ...
|
||||
def copy(self): ...
|
||||
def zoom(self, x, y=''): ...
|
||||
def subsample(self, x, y=''): ...
|
||||
def zoom(self, x, y: str = ...): ...
|
||||
def subsample(self, x, y: str = ...): ...
|
||||
def get(self, x, y): ...
|
||||
def put(self, data, to=None): ...
|
||||
def write(self, filename, format=None, from_coords=None): ...
|
||||
|
||||
@@ -38,7 +38,7 @@ if sys.version_info >= (3, 3):
|
||||
# expecting other classes (as is Mock's purpose)
|
||||
class NonCallableMock(Any): # type: ignore
|
||||
def __new__(cls, *args: Any, **kw: Any) -> Any: ...
|
||||
def __init__(self, spec: Optional[Any] = None, wraps: Optional[Any] = None, name: Optional[Any] = None, spec_set: Optional[Any] = None, parent: Optional[Any] = None, _spec_state: Optional[Any] = None, _new_name: Any ='', _new_parent: Optional[Any] = None, _spec_as_instance: Any = False, _eat_self: Optional[Any] = None, unsafe: Any = False, **kwargs: Any) -> None: ...
|
||||
def __init__(self, spec: Optional[Any] = None, wraps: Optional[Any] = None, name: Optional[Any] = None, spec_set: Optional[Any] = None, parent: Optional[Any] = None, _spec_state: Optional[Any] = None, _new_name: Any = ..., _new_parent: Optional[Any] = None, _spec_as_instance: Any = False, _eat_self: Optional[Any] = None, unsafe: Any = False, **kwargs: Any) -> None: ...
|
||||
def attach_mock(self, mock: Any, attribute: Any) -> Any: ...
|
||||
def mock_add_spec(self, spec: Any, spec_set: Any = False) -> Any: ...
|
||||
return_value = ... # type: Any
|
||||
@@ -64,7 +64,7 @@ if sys.version_info >= (3, 3):
|
||||
|
||||
class CallableMixin(Base):
|
||||
side_effect = ... # type: Any
|
||||
def __init__(self, spec: Optional[Any] = None, side_effect: Optional[Any] = None, return_value: Any = ..., wraps: Optional[Any] = None, name: Optional[Any] = None, spec_set: Optional[Any] = None, parent: Optional[Any] = None, _spec_state: Optional[Any] = None, _new_name: Any = '', _new_parent: Optional[Any] = None, **kwargs: Any) -> None: ...
|
||||
def __init__(self, spec: Optional[Any] = None, side_effect: Optional[Any] = None, return_value: Any = ..., wraps: Optional[Any] = None, name: Optional[Any] = None, spec_set: Optional[Any] = None, parent: Optional[Any] = None, _spec_state: Optional[Any] = None, _new_name: Any = ..., _new_parent: Optional[Any] = None, **kwargs: Any) -> None: ...
|
||||
def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
|
||||
class Mock(CallableMixin, NonCallableMock):
|
||||
@@ -167,7 +167,7 @@ if sys.version_info >= (3, 3):
|
||||
name = ... # type: Any
|
||||
def __init__(self, spec: Any, spec_set: Any = False, parent: Optional[Any] = None, name: Optional[Any] = None, ids: Optional[Any] = None, instance: Any = False) -> None: ...
|
||||
|
||||
def mock_open(mock: Optional[Any] = None, read_data: Any = '') -> Any: ...
|
||||
def mock_open(mock: Optional[Any] = None, read_data: Any = ...) -> Any: ...
|
||||
|
||||
class PropertyMock(Mock):
|
||||
def __get__(self, obj: Any, obj_type: Any) -> Any: ...
|
||||
|
||||
@@ -4,23 +4,7 @@ import sys
|
||||
|
||||
_Str = Union[bytes, str]
|
||||
|
||||
__all__ = (
|
||||
'urlparse',
|
||||
'urlunparse',
|
||||
'urljoin',
|
||||
'urldefrag',
|
||||
'urlsplit',
|
||||
'urlunsplit',
|
||||
'urlencode',
|
||||
'parse_qs',
|
||||
'parse_qsl',
|
||||
'quote',
|
||||
'quote_plus',
|
||||
'quote_from_bytes',
|
||||
'unquote',
|
||||
'unquote_plus',
|
||||
'unquote_to_bytes'
|
||||
)
|
||||
__all__ = ... # type: Tuple[str]
|
||||
|
||||
uses_relative = ... # type: List[str]
|
||||
uses_netloc = ... # type: List[str]
|
||||
|
||||
@@ -8,9 +8,6 @@ stdlib/2/typing.pyi
|
||||
stdlib/3/builtins.pyi
|
||||
stdlib/3/typing.pyi
|
||||
|
||||
# Because of 'class ForkProcess(Any): # type: ignore'
|
||||
stdlib/3/multiprocessing/context.pyi
|
||||
|
||||
# Because of 'from . import path':
|
||||
stdlib/2/os/__init__.pyi
|
||||
stdlib/3/os/__init__.pyi
|
||||
@@ -23,25 +20,17 @@ stdlib/3/concurrent/futures/__init__.pyi
|
||||
stdlib/3/concurrent/futures/_base.pyi
|
||||
stdlib/3/concurrent/futures/process.pyi
|
||||
stdlib/3/concurrent/futures/thread.pyi
|
||||
stdlib/3/email/policy.pyi
|
||||
stdlib/3/fileinput.pyi
|
||||
stdlib/3/gzip.pyi
|
||||
stdlib/3/http/__init__.pyi
|
||||
stdlib/3/http/cookiejar.pyi
|
||||
stdlib/3/inspect.pyi
|
||||
stdlib/3/json/__init__.pyi
|
||||
stdlib/3/json/decoder.pyi
|
||||
stdlib/3/json/encoder.pyi
|
||||
stdlib/3/ssl.pyi
|
||||
stdlib/3/subprocess.pyi
|
||||
stdlib/3/sys.pyi
|
||||
stdlib/3/textwrap.pyi
|
||||
stdlib/3/time.pyi
|
||||
stdlib/3/tkinter/__init__.pyi
|
||||
stdlib/3/types.pyi
|
||||
stdlib/3/unittest/__init__.pyi
|
||||
stdlib/3/unittest/mock.pyi
|
||||
stdlib/3/urllib/parse.pyi
|
||||
stdlib/3/wsgiref/types.pyi
|
||||
stdlib/3.4/asyncio/events.pyi
|
||||
stdlib/3.4/asyncio/futures.pyi
|
||||
@@ -50,4 +39,3 @@ stdlib/3.4/asyncio/queues.pyi
|
||||
stdlib/3.4/asyncio/streams.pyi
|
||||
stdlib/3.4/asyncio/subprocess.pyi
|
||||
stdlib/3.4/asyncio/tasks.pyi
|
||||
stdlib/3.4/enum.pyi
|
||||
|
||||
Reference in New Issue
Block a user