From 9558b36a4557aaf778bab4ed511edd0ef2de8d4c Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 7 Jan 2022 17:17:28 +0000 Subject: [PATCH] range and slice: `start`, `stop`, `step` are read-only (#6849) --- stdlib/builtins.pyi | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 454479b06..6a9a05e86 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -734,9 +734,12 @@ class bool(int): @final class slice: - start: Any - step: Any - stop: Any + @property + def start(self) -> Any: ... + @property + def step(self) -> Any: ... + @property + def stop(self) -> Any: ... @overload def __init__(self, __stop: Any) -> None: ... @overload @@ -945,9 +948,12 @@ class enumerate(Iterator[tuple[int, _T]], Generic[_T]): @final class range(Sequence[int]): - start: int - stop: int - step: int + @property + def start(self) -> int: ... + @property + def stop(self) -> int: ... + @property + def step(self) -> int: ... @overload def __init__(self, __stop: SupportsIndex) -> None: ... @overload