Add optimize parameter to builtins.compile. (#2605)

In Python 3, `builtins.compile` takes 6 arguments (`source`, `filename`, `mode`, `flags=0`, `dont_inherit=False`, `optimize=-1`). This change adds the last `optimize` parameter, which is new since Python 2.
This commit is contained in:
Brandt Bucher
2018-11-16 23:35:32 -08:00
committed by Jelle Zijlstra
parent 232b7c5147
commit b29b239f17

View File

@@ -802,9 +802,9 @@ if sys.version_info >= (3, 6):
# See https://github.com/python/typeshed/pull/991#issuecomment-288160993
class _PathLike(Generic[AnyStr]):
def __fspath__(self) -> AnyStr: ...
def compile(source: Any, filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ...) -> CodeType: ...
def compile(source: Any, filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> CodeType: ...
else:
def compile(source: Any, filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ...) -> CodeType: ...
def compile(source: Any, filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> CodeType: ...
def copyright() -> None: ...
def credits() -> None: ...
def delattr(o: Any, name: str) -> None: ...