Make code.InteractiveInterpreter#locals a dict not a mapping (#13775)

This commit is contained in:
A5rocks
2025-04-02 11:31:41 -04:00
committed by GitHub
parent c7ab79ed1b
commit 54e1817439
+7 -7
View File
@@ -1,15 +1,15 @@
import sys
from codeop import CommandCompiler
from collections.abc import Callable, Mapping
from collections.abc import Callable
from types import CodeType
from typing import Any
__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_command"]
class InteractiveInterpreter:
locals: Mapping[str, Any] # undocumented
locals: dict[str, Any] # undocumented
compile: CommandCompiler # undocumented
def __init__(self, locals: Mapping[str, Any] | None = None) -> None: ...
def __init__(self, locals: dict[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):
@@ -25,11 +25,11 @@ class InteractiveConsole(InteractiveInterpreter):
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
self, locals: dict[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 __init__(self, locals: dict[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: ...
@@ -40,7 +40,7 @@ if sys.version_info >= (3, 13):
def interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
local: dict[str, Any] | None = None,
exitmsg: str | None = None,
local_exit: bool = False,
) -> None: ...
@@ -49,7 +49,7 @@ else:
def interact(
banner: str | None = None,
readfunc: Callable[[str], str] | None = None,
local: Mapping[str, Any] | None = None,
local: dict[str, Any] | None = None,
exitmsg: str | None = None,
) -> None: ...