From ed4865ac5b500d4aff1c040c2092fa416af8a2a0 Mon Sep 17 00:00:00 2001 From: Ashwini Chaudhary Date: Sun, 6 Aug 2017 08:13:42 +0530 Subject: [PATCH] Updated type of 'source' from Any --- stdlib/2/__builtin__.pyi | 5 +++-- stdlib/3/builtins.pyi | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index a681ab6267dc..73fa338517e9 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -8,9 +8,10 @@ from typing import ( Sequence, Mapping, Tuple, List, Any, Dict, Callable, Generic, Set, AbstractSet, FrozenSet, Sized, Reversible, SupportsInt, SupportsFloat, SupportsAbs, 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 abstractmethod, ABCMeta +from ast import AST from mypy_extensions import NoReturn _T = TypeVar('_T') @@ -694,7 +695,7 @@ def any(i: Iterable) -> 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 = 0, +def compile(source: Union[Text, AST], filename: unicode, mode: str, flags: int = 0, dont_inherit: int = 0) -> 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 1958b127025d..0c828562b30e 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -8,6 +8,7 @@ from typing import ( ByteString, Optional, AnyStr, Type, ) from abc import abstractmethod, ABCMeta +from ast import AST from types import TracebackType import sys from mypy_extensions import NoReturn @@ -765,7 +766,7 @@ def ascii(o: object) -> str: ... def bin(number: int) -> str: ... def callable(o: object) -> bool: ... def chr(code: int) -> str: ... -def compile(source: Any, filename: Union[str, bytes], mode: str, flags: int = 0, +def compile(source: Union[str, bytes, AST], filename: Union[str, bytes], mode: str, flags: int = 0, dont_inherit: int = 0) -> Any: ... def copyright() -> None: ... def credits() -> None: ...