Updates to slice built-in (#891)

Makes args and attributes optional.
This commit is contained in:
Andrey Vlasovskikh
2017-01-29 22:16:23 +03:00
committed by Guido van Rossum
parent 2b25b3ef6d
commit 8ce64ce782
2 changed files with 15 additions and 9 deletions

View File

@@ -463,11 +463,14 @@ class bytearray(MutableSequence[int]):
class bool(int, SupportsInt, SupportsFloat):
def __init__(self, o: object = ...) -> None: ...
class slice:
start = 0
step = 0
stop = 0
def __init__(self, start: int, stop: int = 0, step: int = 0) -> None: ...
class slice(object):
start = ... # type: Optional[int]
step = ... # type: Optional[int]
stop = ... # type: Optional[int]
@overload
def __init__(self, stop: int = None) -> None: ...
@overload
def __init__(self, start: int = None, stop: int = None, step: int = None) -> None: ...
class tuple(Sequence[_T_co], Generic[_T_co]):
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...

View File

@@ -481,10 +481,13 @@ class bool(int, SupportsInt, SupportsFloat):
def __init__(self, o: object = ...) -> None: ...
class slice:
start = 0
step = 0
stop = 0
def __init__(self, start: Optional[int], stop: Optional[int] = 0, step: Optional[int] = 0) -> None: ...
start = ... # type: Optional[int]
step = ... # type: Optional[int]
stop = ... # type: Optional[int]
@overload
def __init__(self, stop: int = None) -> None: ...
@overload
def __init__(self, start: int = None, stop: int = None, step: int = None) -> None: ...
class tuple(Sequence[_T_co], Generic[_T_co]):
def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ...