diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 9a5350ee2..50bfb5ad7 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -9,9 +9,10 @@ from typing import ( Sequence, Mapping, Tuple, List, Any, Dict, Callable, Generic, Set, AbstractSet, FrozenSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, SupportsComplex, SupportsRound, IO, BinaryIO, Union, AnyStr, MutableSequence, MutableMapping, - MutableSet, ItemsView, KeysView, ValuesView, Optional, Container, Type + MutableSet, ItemsView, KeysView, ValuesView, Optional, Container, Type, Text ) from abc import ABCMeta +from ast import mod _T = TypeVar('_T') _T_co = TypeVar('_T_co', covariant=True) @@ -745,7 +746,8 @@ def any(i: Iterable[object]) -> bool: ... def bin(number: int) -> str: ... def callable(o: object) -> bool: ... def chr(code: int) -> str: ... -def compile(source: Any, filename: unicode, mode: str, flags: int = ..., +def compile(source: Union[Text, mod], filename: Text, + mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... def delattr(o: Any, name: unicode) -> None: ... def dir(o: object = ...) -> List[str]: ... diff --git a/stdlib/2/builtins.pyi b/stdlib/2/builtins.pyi index 9a5350ee2..50bfb5ad7 100644 --- a/stdlib/2/builtins.pyi +++ b/stdlib/2/builtins.pyi @@ -9,9 +9,10 @@ from typing import ( Sequence, Mapping, Tuple, List, Any, Dict, Callable, Generic, Set, AbstractSet, FrozenSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, SupportsComplex, SupportsRound, IO, BinaryIO, Union, AnyStr, MutableSequence, MutableMapping, - MutableSet, ItemsView, KeysView, ValuesView, Optional, Container, Type + MutableSet, ItemsView, KeysView, ValuesView, Optional, Container, Type, Text ) from abc import ABCMeta +from ast import mod _T = TypeVar('_T') _T_co = TypeVar('_T_co', covariant=True) @@ -745,7 +746,8 @@ def any(i: Iterable[object]) -> bool: ... def bin(number: int) -> str: ... def callable(o: object) -> bool: ... def chr(code: int) -> str: ... -def compile(source: Any, filename: unicode, mode: str, flags: int = ..., +def compile(source: Union[Text, mod], filename: Text, + mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ... def delattr(o: Any, name: unicode) -> None: ... def dir(o: object = ...) -> List[str]: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index ab7b7ad3e..844c8e4d7 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -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: ...