diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 4e2484509c1d..e466d2827529 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -76,7 +76,7 @@ if sys.version_info >= (3, 9): from types import GenericAlias _T = TypeVar("_T") -_I = TypeVar("_I", default=int) +_I = TypeVar("_I", int, bytes, float, bool, default=int) # possibly memoryview types _T_co = TypeVar("_T_co", covariant=True) _T_contra = TypeVar("_T_contra", contravariant=True) _R_co = TypeVar("_R_co", covariant=True) @@ -882,7 +882,7 @@ class memoryview(Sequence[_I]): @overload def cast(self, format: Literal["?"], shape: list[int] | tuple[int, ...] = ...) -> memoryview[bool]: ... @overload - def cast(self, format: _IntegerFormats, shape: list[int] | tuple[int, ...] = ...) -> memoryview: ... + def cast(self, format: _IntegerFormats, shape: list[int] | tuple[int, ...] = ...) -> memoryview[int]: ... @overload def __getitem__(self, key: SupportsIndex | tuple[SupportsIndex, ...], /) -> _I: ... @overload