1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
import sys
from codeop import CommandCompiler
from collections.abc import Callable, Mapping
from types import CodeType
from typing import Any
__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_command"]
class InteractiveInterpreter:
locals: Mapping[str, Any] # undocumented
compile: CommandCompiler # undocumented
def __init__(self, locals: Mapping[str, Any] | None = None) -> None: ...
def runsource(self, source: str, filename: str = "<input>", symbol: str = "single") -> bool: ...
def runcode(self, code: CodeType) -> None: ...
if sys.version_info >= (3, 13):
def showsyntaxerror(self, filename: str | None = None, *, source: str = "") -> None: ...
else:
def showsyntaxerror(self, filename: str | None = None) -> None: ...
def showtraceback(self) -> None: ...
def write(self, data: str) -> None: ...
class InteractiveConsole(InteractiveInterpreter):
buffer: list[str] # undocumented
filename: str # undocumented
if sys.version_info >= (3, 13):
def __init__(
self, locals: Mapping[str, Any] | None = None, filename: str = "<console>", *, local_exit: bool = False
) -> None: ...
def push(self, line: str, filename: str | None = None) -> bool: ...
else:
def __init__(self, locals: Mapping[str, Any] | None = None, filename: str = "<console>") -> None: ...
def push(self, line: str) -> bool: ...
def interact(self, banner: str | None = None, exitmsg: str | None = None) -> None: ...
def resetbuffer(self) -> None: ...
def raw_input(self, prompt: str = "") -> str: ...
if sys.version_info >= (3, 13):
def interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
exitmsg: str | None = None,
local_exit: bool = False,
) -> None: ...
else:
def interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
exitmsg: str | None = None,
) -> None: ...
def compile_command(source: str, filename: str = "<input>", symbol: str = "single") -> CodeType | None: ...
|