Add complete annotations to builtins.compile. (#2606)

This commit is contained in:
Brandt Bucher
2018-11-20 08:48:24 -08:00
committed by Sebastian Rittau
parent 45d4e88175
commit 7685462672
3 changed files with 11 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ from typing import (
)
from abc import abstractmethod, ABCMeta
from types import TracebackType, CodeType
from ast import mod
import sys
# Note that names imported above are not automatically made visible via the
@@ -802,9 +803,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 = ..., optimize: int = ...) -> CodeType: ...
def compile(source: Union[str, bytes, mod], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
else:
def compile(source: Any, filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> CodeType: ...
def compile(source: Union[str, bytes, mod], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
def copyright() -> None: ...
def credits() -> None: ...
def delattr(o: Any, name: str) -> None: ...