From a1e1d6c35509d9dd70816a91812dfaa510229367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rousset?= Date: Fri, 5 Aug 2016 16:55:43 +0200 Subject: [PATCH] Add code (#447) * 30.1.0 * 30.1.1 * 30.1.2 --- stdlib/2and3/code.pyi | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 stdlib/2and3/code.pyi diff --git a/stdlib/2and3/code.pyi b/stdlib/2and3/code.pyi new file mode 100644 index 000000000..e77585175 --- /dev/null +++ b/stdlib/2and3/code.pyi @@ -0,0 +1,27 @@ +# Stubs for code + +from typing import Any, Callable, Mapping, Optional +from types import CodeType + +class InteractiveInterpreter: + def __init__(self, locals: Optional[Mapping[str, Any]] = ...) -> None: ... + def runsource(self, source: str, filename: str = ..., + symbol: str = ...) -> bool: ... + def runcode(self, code: CodeType) -> None: ... + def showsyntaxerror(self, filename: Optional[str] = ...) -> None: ... + def showtraceback(self) -> None: ... + def write(self, data: str) -> None: ... + +class InteractiveConsole(InteractiveInterpreter): + def __init__(self, locals: Optional[Mapping[str, Any]] = ..., + filename: str = ...) -> None: ... + def interact(self, banner: Optional[str] = ...) -> None: ... + def push(self, line: str) -> bool: ... + def resetbuffer(self) -> None: ... + def raw_input(self, prompt: str = ...) -> str: ... + +def interact(banner: Optional[str] = ..., + readfunc: Optional[Callable[[str], str]] = ..., + local: Optional[Mapping[str, Any]] = ...) -> None: ... +def compile_command(source: str, filename: str = ..., + symbol: str = ...) -> Optional[CodeType]: ...