diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 3cdd31591b16..8a71c680399c 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -551,7 +551,10 @@ class str(Sequence[str]): def maketrans(__x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ... @staticmethod @overload - def maketrans(__x: str, __y: str, __z: str | None = ...) -> dict[int, int | None]: ... + def maketrans(__x: str, __y: str) -> dict[int, int]: ... + @staticmethod + @overload + def maketrans(__x: str, __y: str, __z: str) -> dict[int, int | None]: ... @overload def __add__(self: LiteralString, __s: LiteralString) -> LiteralString: ... @overload diff --git a/stdlib/collections/__init__.pyi b/stdlib/collections/__init__.pyi index a9b3467443ee..2835e49df9e2 100644 --- a/stdlib/collections/__init__.pyi +++ b/stdlib/collections/__init__.pyi @@ -191,12 +191,7 @@ class UserString(Sequence[UserString]): def ljust(self: Self, width: int, *args: Any) -> Self: ... def lower(self: Self) -> Self: ... def lstrip(self: Self, chars: str | None = None) -> Self: ... - @staticmethod - @overload - def maketrans(x: dict[int, _T] | dict[str, _T] | dict[str | int, _T]) -> dict[int, _T]: ... - @staticmethod - @overload - def maketrans(x: str, y: str, z: str = ...) -> dict[int, int | None]: ... + maketrans = str.maketrans def partition(self, sep: str) -> tuple[str, str, str]: ... if sys.version_info >= (3, 9): def removeprefix(self: Self, __prefix: str | UserString) -> Self: ... diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index 22abbe9939ba..27209691f6f7 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -24,7 +24,6 @@ collections.AsyncGenerator.ag_frame collections.AsyncGenerator.ag_running collections.Callable collections.Mapping.__reversed__ # Set to None at runtime for a better error message -collections.UserString.maketrans contextvars.ContextVar.get distutils.command.bdist_wininst # see #6523 dummy_threading.Condition.acquire