mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-08 02:40:58 +08:00
Add complete annotations to builtins.compile. (#2606)
This commit is contained in:
committed by
Sebastian Rittau
parent
45d4e88175
commit
7685462672
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user