mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Add attribute types to code.InteractiveInterpreter and code.InteractiveConsole (#5830)
* mark undocumented attributes * use pep 585 generics, replace optional types with pep 604-style hints
This commit is contained in:
@@ -1,25 +1,30 @@
|
||||
from codeop import CommandCompiler
|
||||
from types import CodeType
|
||||
from typing import Any, Callable, Mapping, Optional
|
||||
from typing import Any, Callable, Mapping
|
||||
|
||||
class InteractiveInterpreter:
|
||||
def __init__(self, locals: Optional[Mapping[str, Any]] = ...) -> None: ...
|
||||
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: Optional[str] = ...) -> None: ...
|
||||
def showsyntaxerror(self, filename: str | None = ...) -> 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] = ..., exitmsg: Optional[str] = ...) -> None: ...
|
||||
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: Optional[str] = ...,
|
||||
readfunc: Optional[Callable[[str], str]] = ...,
|
||||
local: Optional[Mapping[str, Any]] = ...,
|
||||
exitmsg: Optional[str] = ...,
|
||||
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 = ...) -> Optional[CodeType]: ...
|
||||
def compile_command(source: str, filename: str = ..., symbol: str = ...) -> CodeType | None: ...
|
||||
|
||||
Reference in New Issue
Block a user