diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 9c8394ced492..4c78ea9b478f 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -66,7 +66,7 @@ from typing import ( # noqa: Y022 # ruff: ignore[deprecated-import] # we can't import `Literal` from typing or mypy crashes: see #11247 # ruff: ignore[deprecated-import] -from typing_extensions import Buffer, Literal, LiteralString, Self, TypeIs, TypeVarTuple, deprecated, disjoint_base # noqa: Y023 +from typing_extensions import Literal, LiteralString, Self, TypeIs, TypeVarTuple, deprecated, disjoint_base # noqa: Y023 if sys.version_info >= (3, 14): from _typeshed import AnnotateFunc @@ -828,7 +828,8 @@ class bytes(Sequence[int]): def __add__(self, value: ReadableBuffer, /) -> bytes: ... def __mul__(self, value: SupportsIndex, /) -> bytes: ... def __rmul__(self, value: SupportsIndex, /) -> bytes: ... - def __mod__(self, value: Buffer | SupportsBytes | tuple[Buffer | SupportsBytes, ...], /) -> bytes: ... + # The format string chooses the conversion, including numbers and %a/%r (PEP 461). + def __mod__(self, value: Any, /) -> bytes: ... def __rmod__(self, value: bytes, /) -> bytes: ... # Incompatible with Sequence.__contains__ def __contains__(self, key: SupportsIndex | ReadableBuffer, /) -> bool: ... # type: ignore[override] @@ -960,7 +961,8 @@ class bytearray(MutableSequence[int]): def __mul__(self, value: SupportsIndex, /) -> bytearray: ... def __rmul__(self, value: SupportsIndex, /) -> bytearray: ... def __imul__(self, value: SupportsIndex, /) -> Self: ... - def __mod__(self, value: Buffer | SupportsBytes | tuple[Buffer | SupportsBytes, ...], /) -> bytearray: ... + # The format string chooses the conversion, including numbers and %a/%r (PEP 461). + def __mod__(self, value: Any, /) -> bytearray: ... def __rmod__(self, value: bytearray, /) -> bytearray: ... # Incompatible with Sequence.__contains__ def __contains__(self, key: SupportsIndex | ReadableBuffer, /) -> bool: ... # type: ignore[override]