Skip to main content

Slice

Standard library class internal.types.slice.Slice View source
class Slice
@tuple
class Slice[T, U, V]
Fields 6
start Optional[T]
stop Optional[U]
step Optional[V]
T type
U type
V type
Constructors 3
__new__
__new__[U: type = int](stop: Optional[U], /) -> Slice[(int, U, int)]
__new__
@overload
__new__[T: type = int, U: type = int](start: Optional[T], stop: Optional[U], /) -> Slice[(T, U, int)]
__new__
@overload
__new__[T: type = int, U: type = int, V: type = int](start: Optional[T], stop: Optional[U], step: Optional[V], /) -> Slice[(T, U, V)]
Methods 3
adjust_indices
adjust_indices(self: Self, length: int) -> Tuple[(int, int, int, int)]
adjust_indices_helper
adjust_indices_helper(length: int, start: int, stop: int, step: int) -> Tuple[(int, int, int, int)]
indices
indices(self: Self, length: int, /)
Special methods 5
__repr__
@overload
__repr__(self: Self, /)
__eq__
@overload
__eq__(self: Self, other: Slice, /)
__ne__
@overload
__ne__(self: Self, other: Slice, /)
__to_py__
__to_py__(self: Self) -> cobj
__from_py__
__from_py__(s: cobj) -> Slice