mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
33 lines
1.4 KiB
Python
33 lines
1.4 KiB
Python
from codeop import CommandCompiler
|
|
from types import CodeType
|
|
from typing import Any, Callable, Mapping
|
|
|
|
__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: ...
|
|
def runsource(self, source: str, filename: str = ..., symbol: str = ...) -> bool: ...
|
|
def runcode(self, code: CodeType) -> None: ...
|
|
def showsyntaxerror(self, filename: str | None = ...) -> None: ...
|
|
def showtraceback(self) -> None: ...
|
|
def write(self, data: str) -> None: ...
|
|
|
|
class InteractiveConsole(InteractiveInterpreter):
|
|
buffer: list[str] # undocumented
|
|
filename: str # undocumented
|
|
def __init__(self, locals: Mapping[str, Any] | None = ..., filename: str = ...) -> None: ...
|
|
def interact(self, banner: str | None = ..., exitmsg: str | None = ...) -> None: ...
|
|
def push(self, line: str) -> bool: ...
|
|
def resetbuffer(self) -> None: ...
|
|
def raw_input(self, prompt: str = ...) -> str: ...
|
|
|
|
def interact(
|
|
banner: str | None = ...,
|
|
readfunc: Callable[[str], str] | None = ...,
|
|
local: Mapping[str, Any] | None = ...,
|
|
exitmsg: str | None = ...,
|
|
) -> None: ...
|
|
def compile_command(source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ...
|