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:
Guido van Rossum
2017-06-20 22:18:49 -07:00
committed by Jelle Zijlstra
parent 30256097ea
commit 04fe184dcf
23 changed files with 257 additions and 237 deletions

View File

@@ -1,21 +1,21 @@
# Stubs for bz2
from typing import Any, BinaryIO, TextIO, IO, Union
from typing import Any, BinaryIO, TextIO, IO, Optional, Union
def compress(data: bytes, compresslevel: int = ...) -> bytes: ...
def decompress(data: bytes) -> bytes: ...
def open(filename: Union[str, bytes, IO[Any]],
mode: str = 'rb',
encoding: str = None,
errors: str = None,
newline: str = None) -> IO[Any]: ...
encoding: Optional[str] = None,
errors: Optional[str] = None,
newline: Optional[str] = None) -> IO[Any]: ...
class BZ2File(BinaryIO):
def __init__(self,
filename: Union[str, bytes, IO[Any]],
mode: str = "r",
buffering: Any = None,
buffering: Optional[Any] = None,
compresslevel: int = 9) -> None: ...
class BZ2Compressor(object):