mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
More precise type for 'slice' constructor
start and stop arguments are required even though they can be None.
This commit is contained in:
committed by
Łukasz Langa
parent
55d4c08a8e
commit
43c1369901
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user