mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 08:04:24 +08:00
[builtins] Add 'AST' type to 'source' parameter for 'compile()' (#2889)
This commit is contained in:
committed by
Sebastian Rittau
parent
a1d1870779
commit
598d0d6ae1
@@ -10,7 +10,7 @@ from typing import (
|
||||
Protocol,
|
||||
)
|
||||
from abc import abstractmethod, ABCMeta
|
||||
from ast import mod
|
||||
from ast import mod, AST
|
||||
from types import TracebackType, CodeType
|
||||
import sys
|
||||
|
||||
@@ -1117,9 +1117,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: Union[str, bytes, mod], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
|
||||
def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
|
||||
elif sys.version_info >= (3,):
|
||||
def compile(source: Union[str, bytes, mod], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
|
||||
def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
|
||||
else:
|
||||
def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ...
|
||||
if sys.version_info >= (3,):
|
||||
|
||||
@@ -10,7 +10,7 @@ from typing import (
|
||||
Protocol,
|
||||
)
|
||||
from abc import abstractmethod, ABCMeta
|
||||
from ast import mod
|
||||
from ast import mod, AST
|
||||
from types import TracebackType, CodeType
|
||||
import sys
|
||||
|
||||
@@ -1117,9 +1117,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: Union[str, bytes, mod], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
|
||||
def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes, _PathLike], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
|
||||
elif sys.version_info >= (3,):
|
||||
def compile(source: Union[str, bytes, mod], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
|
||||
def compile(source: Union[str, bytes, mod, AST], filename: Union[str, bytes], mode: str, flags: int = ..., dont_inherit: int = ..., optimize: int = ...) -> Any: ...
|
||||
else:
|
||||
def compile(source: Union[Text, mod], filename: Text, mode: Text, flags: int = ..., dont_inherit: int = ...) -> Any: ...
|
||||
if sys.version_info >= (3,):
|
||||
|
||||
Reference in New Issue
Block a user