From 43c13699013e67cb5e3156fb0d26b01684c51cfd Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Mon, 20 Feb 2017 21:48:50 +0300 Subject: [PATCH] More precise type for 'slice' constructor start and stop arguments are required even though they can be None. --- stdlib/2/__builtin__.pyi | 4 ++-- stdlib/3/builtins.pyi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 59b01e58a..83e6c29be 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -470,9 +470,9 @@ class slice(object): step = ... # type: Optional[int] stop = ... # type: Optional[int] @overload - def __init__(self, stop: int = None) -> None: ... + def __init__(self, stop: Optional[int]) -> None: ... @overload - def __init__(self, start: int = None, stop: int = None, step: int = None) -> None: ... + def __init__(self, start: Optional[int], stop: Optional[int], step: int = None) -> None: ... class tuple(Sequence[_T_co], Generic[_T_co]): def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 3c82247a6..185ee8163 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -517,9 +517,9 @@ class slice: step = ... # type: Optional[int] stop = ... # type: Optional[int] @overload - def __init__(self, stop: int = None) -> None: ... + def __init__(self, stop: Optional[int]) -> None: ... @overload - def __init__(self, start: int = None, stop: int = None, step: int = None) -> None: ... + def __init__(self, start: Optional[int], stop: Optional[int], step: int = None) -> None: ... class tuple(Sequence[_T_co], Generic[_T_co]): def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...