mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-16 11:34:56 +08:00
Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy (#1421)
* Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy
* Make implicit Optional explicit in arg types (2and3 part)
* Convert {stdlib,third_party}/2 to explicit Optional
This commit is contained in:
committed by
Jelle Zijlstra
parent
30256097ea
commit
04fe184dcf
@@ -485,7 +485,7 @@ class slice(object):
|
||||
@overload
|
||||
def __init__(self, stop: Optional[int]) -> None: ...
|
||||
@overload
|
||||
def __init__(self, start: Optional[int], stop: Optional[int], step: int = None) -> None: ...
|
||||
def __init__(self, start: Optional[int], stop: Optional[int], step: Optional[int] = None) -> None: ...
|
||||
def indices(self, len: int) -> Tuple[int, int, int]: ...
|
||||
|
||||
class tuple(Sequence[_T_co], Generic[_T_co]):
|
||||
@@ -676,13 +676,13 @@ class xrange(Sized, Iterable[int], Reversible[int]):
|
||||
def __reversed__(self) -> Iterator[int]: ...
|
||||
|
||||
class property(object):
|
||||
def __init__(self, fget: Callable[[Any], Any] = None,
|
||||
fset: Callable[[Any, Any], None] = None,
|
||||
fdel: Callable[[Any], None] = None, doc: str = None) -> None: ...
|
||||
def __init__(self, fget: Optional[Callable[[Any], Any]] = None,
|
||||
fset: Optional[Callable[[Any, Any], None]] = None,
|
||||
fdel: Optional[Callable[[Any], None]] = None, doc: Optional[str] = None) -> None: ...
|
||||
def getter(self, fget: Callable[[Any], Any]) -> property: ...
|
||||
def setter(self, fset: Callable[[Any, Any], None]) -> property: ...
|
||||
def deleter(self, fdel: Callable[[Any], None]) -> property: ...
|
||||
def __get__(self, obj: Any, type: type=None) -> Any: ...
|
||||
def __get__(self, obj: Any, type: Optional[type] = None) -> Any: ...
|
||||
def __set__(self, obj: Any, value: Any) -> None: ...
|
||||
def __delete__(self, obj: Any) -> None: ...
|
||||
def fget(self) -> Any: ...
|
||||
@@ -716,7 +716,7 @@ def filter(function: Callable[[_T], Any],
|
||||
def filter(function: None,
|
||||
iterable: Iterable[Optional[_T]]) -> List[_T]: ...
|
||||
def format(o: object, format_spec: str = '') -> str: ... # TODO unicode
|
||||
def getattr(o: Any, name: unicode, default: Any = None) -> Any: ...
|
||||
def getattr(o: Any, name: unicode, default: Optional[Any] = None) -> Any: ...
|
||||
def hasattr(o: Any, name: unicode) -> bool: ...
|
||||
def hash(o: object) -> int: ...
|
||||
def hex(i: int) -> str: ... # TODO __index__
|
||||
@@ -941,12 +941,12 @@ class ResourceWarning(Warning): ...
|
||||
|
||||
def eval(s: str, globals: Dict[str, Any] = ..., locals: Dict[str, Any] = ...) -> Any: ...
|
||||
def exec(object: str,
|
||||
globals: Dict[str, Any] = None,
|
||||
locals: Dict[str, Any] = None) -> Any: ... # TODO code object as source
|
||||
globals: Optional[Dict[str, Any]] = None,
|
||||
locals: Optional[Dict[str, Any]] = None) -> Any: ... # TODO code object as source
|
||||
|
||||
def cmp(x: Any, y: Any) -> int: ...
|
||||
|
||||
def execfile(filename: str, globals: Dict[str, Any] = None, locals: Dict[str, Any] = None) -> None: ...
|
||||
def execfile(filename: str, globals: Optional[Dict[str, Any]] = None, locals: Optional[Dict[str, Any]] = None) -> None: ...
|
||||
|
||||
class file(BinaryIO):
|
||||
@overload
|
||||
@@ -958,7 +958,7 @@ class file(BinaryIO):
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def __enter__(self) -> BinaryIO: ...
|
||||
def __exit__(self, t: type = None, exc: BaseException = None, tb: Any = None) -> bool: ...
|
||||
def __exit__(self, t: Optional[type] = None, exc: Optional[BaseException] = None, tb: Optional[Any] = None) -> bool: ...
|
||||
def flush(self) -> None: ...
|
||||
def fileno(self) -> int: ...
|
||||
def isatty(self) -> bool: ...
|
||||
@@ -976,6 +976,6 @@ class file(BinaryIO):
|
||||
def truncate(self, pos: Optional[int] = ...) -> int: ...
|
||||
|
||||
# Very old builtins
|
||||
def apply(func: Callable[..., _T], args: Sequence[Any] = None, kwds: Mapping[str, Any] = None) -> _T: ...
|
||||
def apply(func: Callable[..., _T], args: Optional[Sequence[Any]] = None, kwds: Optional[Mapping[str, Any]] = None) -> _T: ...
|
||||
_N = TypeVar('_N', bool, int, float, complex)
|
||||
def coerce(x: _N, y: _N) -> Tuple[_N, _N]: ...
|
||||
|
||||
@@ -41,7 +41,7 @@ class Request(object):
|
||||
def add_header(self, key: str, val: str) -> None: ...
|
||||
def add_unredirected_header(self, key: str, val: str) -> None: ...
|
||||
def has_header(self, header_name: str) -> bool: ...
|
||||
def get_header(self, header_name: str, default: str = None) -> str: ...
|
||||
def get_header(self, header_name: str, default: Optional[str] = None) -> str: ...
|
||||
def header_items(self): ...
|
||||
|
||||
class OpenerDirector(object):
|
||||
|
||||
Reference in New Issue
Block a user