More precise type for 'slice' constructor

start and stop arguments are required even though they can be None.
This commit is contained in:
Andrey Vlasovskikh
2017-02-20 21:48:50 +03:00
committed by Łukasz Langa
parent 55d4c08a8e
commit 43c1369901
2 changed files with 4 additions and 4 deletions

View File

@@ -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: ...

View File

@@ -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: ...