asyncutils._internal.types¶
from asyncutils._internal.types import *.Tip
For inline type annotations, wrap the imports in if TYPE_CHECKING: blocks.
Tip
Besides, run from __future__ import annotations on the top of the file for Python 3.13 or below, so that the annotations need not be quoted even
prior to the implementation of PEP 563, which introduced deferred annotation evaluation.
Attributes¶
Type of the |
|
Return type of |
|
The type of |
|
The type of objects that may follow an except statement. |
|
The return type of |
|
Type of strings representing executors that can be passed to -e/--executor. |
|
Names of algorithms used for calculating checksums. The default is |
|
Objects accepted by the |
|
Represents a middleware accepted by |
|
Exceptions that are not exception groups. |
|
The type of |
|
The type of the |
|
The type of the return values of the |
|
Anything that can normally be passed to the built-in |
|
A supposed callable object having a |
|
The type of the context managers returned by the |
|
Possible values of the |
|
The type of a positional argument passed to a signature-patching function in |
|
The type of subscribers for |
|
Type of strings representing |
|
Objects that support (async) iteration. |
|
Objects implementing one of the operators < and >. |
|
Type of functions that return the current time under some specification, such as |
|
A slice with start, stop and step being integers or |
|
The type of wildcard subscribers for |
|
A function or wrapper of any depth thereof. |
Classes¶
Simple async-only version of |
|
The type of each consumer in the tuple return value of |
|
A protocol version of |
|
An object that behaves like an asynchronous lock. |
|
The return type of |
|
An iterable that supports clearing and shallow copying. |
|
A writable and flushable 'stream'. |
|
Protocol for the strict decorator factory overload of |
|
The return type of various decorator factories in |
|
Return type of |
|
Encapsulates the signature of simple json-dumping functions accepted by |
|
Protocol for event objects. |
|
The type of functions taken by |
|
Return type of |
|
The return type of |
|
Same as above. |
|
Intermediate protocol to build the recursive definition of |
|
The barest of protocol for future-like objects such that the class is accepted at runtime by |
|
The signature of the functions accepted for the |
|
Objects such as those returned by |
|
A generic version of |
|
Queues for which both |
|
Queues for which |
|
Since the type system does not allow modelling a type variable to have an upper bound parametrized by another type variable, this is necessary to type the return type of |
|
The type of async memory-mapped files as opened and returned by |
|
Metaclass for 'partial interfaces', described below. |
|
An object that represents a path. Basically |
|
Queues for which |
|
A base protocol representing password-protected queues. |
|
The return type of the |
|
The type of |
|
|
|
Type of snapshots of the current state of a |
|
Return type of the |
|
An object that implements the > operator. |
|
An object that implements the < operator. |
|
Objects that implement matrix multiplication to return an instance of its own type. |
|
Types with a |
|
Types with a |
|
Protocol for iterables with size, and index and slice access. |
|
The signature of the return value of |
|
The signature of the return value of |
|
Type of |
|
|
Module Contents¶
- class asyncutils._internal.types.ANCT¶
Simple async-only version of
contextlib.nullcontextthat does not depend oncontextlib.Note
This does not support the
enter_resultargument of the original.- async __aexit__(exc_typ: ExcType, exc_val: BaseException, exc_tb: types.TracebackType, /) None¶
- async __aexit__(exc_typ: None, exc_val: None, exc_tb: None, /) None
- class asyncutils._internal.types.AUnzipConsumer[T]¶
The type of each consumer in the tuple return value of
iters.aunzip().- __aiter__() Self¶
- async __anext__() T¶
- class asyncutils._internal.types.AsyncContextManager[T]¶
Bases:
ProtocolA protocol version of
contextlib.AbstractAsyncContextManagerwith proper overloads.- async __aenter__() T¶
- class asyncutils._internal.types.AsyncLockLike[T]¶
Bases:
AsyncContextManager[T],ProtocolAn object that behaves like an asynchronous lock.
- release() collections.abc.Awaitable[None] | None¶
- class asyncutils._internal.types.BenchmarkResult¶
Bases:
NamedTupleThe return type of
func.benchmark().
- class asyncutils._internal.types.CanClearAndCopy[T]¶
Bases:
ProtocolAn iterable that supports clearing and shallow copying.
- __iter__() collections.abc.Iterator[T]¶
- copy() Self¶
- class asyncutils._internal.types.CanWriteAndFlush[T]¶
Bases:
ProtocolA writable and flushable ‘stream’.
- class asyncutils._internal.types.DCRV¶
Bases:
ProtocolProtocol for the strict decorator factory overload of
util.dualcontextmanager().- __call__[T, **P](
- gfunc: collections.abc.Callable[P, collections.abc.Iterable[T]],
- /,
- __call__(
- agfunc: collections.abc.Callable[P, collections.abc.AsyncIterable[T]],
- /,
- class asyncutils._internal.types.DecoratorFactoryRV¶
Bases:
ProtocolThe return type of various decorator factories in
asyncutils.func, includingdebounce(),throttle()anddebounce().- __call__[T, **P](
- f: collections.abc.Callable[P, collections.abc.Awaitable[T]],
- /,
- class asyncutils._internal.types.DualContextManager[T]¶
Bases:
contextlib.AbstractContextManager[T,bool],contextlib.AbstractAsyncContextManager[T,bool],ProtocolReturn type of
@util.dualcontextmanager. The initialization signature of this class is not documented intentionally.
- class asyncutils._internal.types.DumpType¶
Bases:
ProtocolEncapsulates the signature of simple json-dumping functions accepted by
argv_to_json()andargstr_to_json().- __call__(dct: dict[str, Any], file: io.TextIOWrapper[io._WrappedBuffer], /) None¶
- class asyncutils._internal.types.EventProt¶
Bases:
ProtocolProtocol for event objects.
- async wait() Any¶
Asynchronously wait until the event is set.
- class asyncutils._internal.types.EveryMethodFT[T, R]¶
Bases:
ProtocolThe type of functions taken by
EveryMethodRV.- __call__(self_: T, /, *a: object, **k: object) collections.abc.Awaitable[R]¶
- class asyncutils._internal.types.EveryMethodRVRV[T, R]¶
Bases:
ProtocolReturn type of
EveryMethodRV.
- class asyncutils._internal.types.EveryRV[T]¶
Bases:
ProtocolThe return type of
func.every().- __call__[**P](
- f: collections.abc.Callable[P, collections.abc.Awaitable[T]],
- /,
- class asyncutils._internal.types.FuncWrapper[W]¶
Bases:
ProtocolIntermediate protocol to build the recursive definition of
Wrapper.- property __wrapped__: W¶
- class asyncutils._internal.types.FutProt[T]¶
Bases:
ProtocolThe barest of protocol for future-like objects such that the class is accepted at runtime by
util.done_fut(). Does not require the object to be awaitable, for instance.- exception() BaseException | None¶
Return the exception set on the future if any.
- result() T¶
Return the result or raise the exception set on the future.
- set_exception(exc: BaseException, /) None¶
Set an exception on the future, causing it to be raised by any waiters.
- class asyncutils._internal.types.FutWrapType¶
Bases:
ProtocolThe signature of the functions accepted for the
futwrapparameter inconvert_to_coro_iter().- __call__[T](
- future: asyncio.Future[T] | concurrent.futures.Future[T],
- *,
- loop: asyncio.AbstractEventLoop | None,
- class asyncutils._internal.types.GeneratorCoroutine[Y, S, R]¶
Bases:
collections.abc.Generator[Y,S,R],collections.abc.Coroutine[Y,S,R]Objects such as those returned by
@types.coroutine-decorated generator functions.- __await__() collections.abc.Generator[Any, None, R]¶
- send(val: S, /) Y¶
Send a value into the generator. Return next yielded value or raise StopIteration.
- throw(typ: ExcType, val: object = ..., tb: types.TracebackType | None = ..., /) Y¶
- throw(exc: BaseException, val: None = ..., tb: types.TracebackType | None = ..., /) Y
Raise an exception in the generator. Return next yielded value or raise StopIteration.
- property gi_code: types.CodeType¶
- property gi_yieldfrom: collections.abc.Iterator[Y] | None¶
- class asyncutils._internal.types.GenericSized[T]¶
Bases:
ProtocolA generic version of
typing.Sized.- __iter__() collections.abc.Iterator[T]¶
- class asyncutils._internal.types.GetAndPutProtectedQProt[R, V, T]¶
Bases:
GetProtectedQProt[R,T],PutProtectedQProt[V,T],QProt[R,V,T],ProtocolQueues for which both
get()andput()are protected by passwords. There is no requirement as to whether they are the same or different.
- class asyncutils._internal.types.GetProtectedQProt[R, T]¶
Bases:
QProt[R,Any,T],ProtocolQueues for which
get()is protected by a password.- async get(pwd: R) T¶
Remove and return an item from the password-protected queue, if the password provided was correct; raise
exceptions.WrongPasswordotherwise. If the queue is empty, wait until an item is available.
- get_nowait(pwd: R) T¶
Remove and return an item from the password-protected queue, if the password provided was correct; raise
exceptions.WrongPasswordotherwise. If the queue is empty, raiseQueueEmpty.
- class asyncutils._internal.types.IncompleteFut[T](*a: object, **k: object)¶
Bases:
FutProt[T],PartialInterfaceSince the type system does not allow modelling a type variable to have an upper bound parametrized by another type variable, this is necessary to type the return type of
util.done_fut()while losing much type information.
- class asyncutils._internal.types.MemoryMappedFile¶
Bases:
asyncutils.mixins.LoopContextMixinThe type of async memory-mapped files as opened and returned by
MemoryMappedIOManager.- __aiter__() collections.abc.AsyncGenerator[bytes]¶
Return an asynchronous iterator over the lines of the file.
- __iter__() collections.abc.Iterator[bytes]¶
Return an iterator over the lines of the file.
- async aclose() None¶
Close the memory-mapped file and the underlying file concurrently in async. It is safe to call this method multiple times, but no other methods should be called after closing.
- close() None¶
Close the memory-mapped file and the underlying file. It is safe to call this method multiple times, but no other methods should be called after closing.
- async compact() int¶
Reduce the size of the file by stripping all contiguous null bytes at the end, and return the number of bytes removed.
- async compare(other: Self, /, size: int = ..., offset_self: int = ..., offset_other: int = ...) bool¶
Compare a range of bytes in this file with a range in another file.
- async copy_range(src_offset: int, dest_offset: int, size: int) bool¶
Copy a range of bytes from one location to another in the file.
- async fill(pattern: bytes, offset: int = ..., count: int = ...) None¶
Fill a range of the file with a repeating pattern of bytes.
- find(sub: bytes, start: int | None = ..., end: int | None = ...) int¶
Return the lowest index in the file where the bytes
subis found, such thatsubis contained in the slicefile[start:end]. Return -1 ifsubis not found.
- async flush(offset: int = ..., size: int | None = ..., /) None¶
Flush the file, or a portion of it if
offsetandsizeare specified. IfsizeisNone, flush until the end of the file.
- async hamming_dist(other: Self, /, size: int = ..., offset_self: int = ..., offset_other: int = ...) int¶
Calculate the Hamming distance in bits between a range of bytes in this file and a range in another file.
- async hamming_dist_bytes(other: Self, /, size: int = ..., offset_self: int = ..., offset_other: int = ...) int¶
Calculate the Hamming distance in bytes between a range of bytes in this file and a range in another file.
- madvise(option: int, start: int = ..., length: int | None = ...) None¶
Advise the kernel about how to handle the memory map by making the
madvisesystem call.
- async move(dest: int, src: int, count: int) None¶
Move
countbytes of data within the file starting fromsrctodest.
- async read(offset: int = ..., size: int = ...) bytes¶
Read
sizebytes from the file atoffset. A negativesizereads until the end of the file.
- read_byte() int¶
Read one byte from the file at the current file pointer, advance the pointer and return the byte as an integer >=0, <256.
- async read_str(offset: int = ..., size: int = ..., encoding: str = ..., errors: str = ...) str¶
Version of
read()returning a string instead, decoded with the specifiedencodinganderrors.
- async read_until(delim: bytes, offset: int = ..., maxsize: int = ...) tuple[bytes, int]¶
Read bytes from the file until the delimiter is found or the maximum size is reached.
- readable() Literal[True]¶
Implemented to always return
Trueto satisfy the file interface.
- async readline(offset: int = ..., size: int | None = ..., incl_newline: bool = ...) bytes¶
Read a line from the file at
offset, up to a maximum ofsizebytes ifsizeis notNone, and return it, optionally including the newline character.
- async readlines(hint: int = ...) list[bytes]¶
Read lines from the file until the total size of the lines read reaches or exceeds
hintifhintis non-negative, and return a list of the lines read.
- async replace(old: bytes, new: bytes, offset: int = ..., count: int = ...) int¶
Replace occurrences of a pattern in the file with a new pattern.
- resize(newsize: int) None¶
Resize the file to
newsizebytes. If the file is extended, the added bytes are zero-filled.
- rfind(sub: bytes, start: int | None = ..., end: int | None = ...) int¶
Return the highest index in the file where the bytes
subis found, such thatsubis contained in the slicefile[start:end]. Return -1 ifsubis not found.
- async search(pattern: bytes, offset: int = ..., max_results: int = ...) list[int]¶
Return a list of the offsets of the first
max_resultsoccurrences ofpatternin the file starting fromoffset.
- search_lazy(pattern: bytes, offset: int = ...) collections.abc.AsyncGenerator[int]¶
Search for a pattern in the file starting from the specified offset, yielding the offsets of each occurrence found as they are found.
- search_lazy_nonoverlapping(pattern: bytes, offset: int = ...) collections.abc.AsyncGenerator[int]¶
The above, but ensure the offsets returned do not overlap using a greedy approach.
- async search_nonoverlapping(pattern: bytes, offset: int = ..., max_results: int = ...) list[int]¶
The above, but ensure the offsets returned do not overlap. Greedy.
- seekable() Literal[True]¶
Implemented to always return
Trueto satisfy the file interface.
- async smart_write(data: str, offset: int = ..., encoding: str = ..., errors: str = ...) None¶
- async smart_write(data: bytes, offset: int = ...) None
Write data to the file at the specified offset, automatically encoding strings.
- writable() Literal[True]¶
Implemented to always return
Trueto satisfy the file interface.
- write_byte(b: int, /) None¶
Write a byte to the file at the current file pointer and advance the pointer.
- async write_str(text: str, offset: int = ..., encoding: str = ..., errors: str = ...) None¶
Write a string to the file at the specified offset, encoded with the specified
encodinganderrors.
- async writelines(lines: collections.abc.Iterable[bytes], /, *, sep: bytes = ..., minimize_writes: bool = ...) None¶
Write each line in
lines, followed bysep, into the file. Ifminimize_writesisTrue(defaultcontext.MEMORY_MAPPED_IO_MANAGER_DEFAULT_MINIMIZE_WRITES), write all the lines in one call.
- class asyncutils._internal.types.PartialInterface(*a: object, **k: object)¶
- Base class for partial interfaces.If it is only known that a class implements an interface, static code analysis tools might emit diagnostics on unrecognized attributes thatmay actually exist on the object or class.This is a simplistic fix that asks type checkers to assume those attributes always exist and make no attempt to infer their types.
- class asyncutils._internal.types.PartialInterfaceMeta¶
Bases:
typeMetaclass for ‘partial interfaces’, described below.
- class asyncutils._internal.types.PathLike[T]¶
Bases:
ProtocolAn object that represents a path. Basically
os.PathLike, but aProtocol.- __fspath__() T¶
- class asyncutils._internal.types.PutProtectedQProt[V, T]¶
Bases:
QProt[Any,V,T],ProtocolQueues for which
put()is protected by a password.
- class asyncutils._internal.types.QProt[R, V, T]¶
Bases:
ProtocolA base protocol representing password-protected queues.
- cancel_extend(msg: object = ...) bool¶
- Cancel the currently running task to put in the initial items to the queue asynchronously, optionally with a message, which willbe the argument for the
CancelledErrorseen by the extender if any.ReturnFalseif the task is already done or cancelled, or there was no task to begin with.
- change_get_password(old_pwd: R, new_pwd: R) bool¶
Attempt to change the get password of the password-protected queue to
new_pwdgivenold_pwdand return success. Always fails if the queue does not protect gets or is empty and has been shut down.
- change_put_password(old_pwd: V, new_pwd: V) bool¶
Attempt to change the put password of the password-protected queue to
new_pwdgivenold_pwdand return success. Always fails if the queue does not protect puts or has been shut down.
- async get() T¶
Asynchronously get an item from the queue; if the queue is empty, wait until an item is available.
- get_nowait() T¶
Get an item from the queue immediately; raise
QueueEmptyif impossible.
- async join() None¶
Wait until
task_done()has been called for each item put into the queue.
- async put(item: T) None¶
Asynchronously put an item into the queue; if the queue is full, wait until a free slot is available.
- shutdown(immediate: bool = ...) None¶
Shut down the queue. If
immediateisTrue, pending gets raise immediately even if the queue is not empty.
- exc: type[asyncutils.exceptions.ForbiddenOperation]¶
Convenience alias for
ForbiddenOperation.
- class asyncutils._internal.types.RWLockRV[T, **P]¶
Bases:
ProtocolThe return type of the
reader()andwriter()methods ofRWLockand subclasses thereof.- __call__(*a: P, **k: P) types.CoroutineType[Any, Any, T]¶
- reader(f: collections.abc.Callable[P, collections.abc.Awaitable[T]], /) Self¶
Mark another function as a reader and return an object with
reader()andwriter()methods.
- writer(f: collections.abc.Callable[P, collections.abc.Awaitable[T]], /) Self¶
Mark another function as a writer and return an object with
reader()andwriter()methods.
- class asyncutils._internal.types.RaiseType¶
Bases:
asyncutils.constants.sentinel_baseThe type of
constants.RAISE.
- class asyncutils._internal.types.Reader[T]¶
Bases:
Protocolio.Readeris not used due to version compatibility issues.
- class asyncutils._internal.types.StateSnapshot¶
Bases:
NamedTupleType of snapshots of the current state of a
channels.Rendezvousobject as returned by itsstate_snapshot()method.
- class asyncutils._internal.types.SubscriptionRV¶
Bases:
ProtocolReturn type of the
subscribe(),subscribe_nowait()andntimes()methods ofchannels.Observable.
- class asyncutils._internal.types.SupportsGT¶
Bases:
ProtocolAn object that implements the > operator.
- class asyncutils._internal.types.SupportsLT¶
Bases:
ProtocolAn object that implements the < operator.
- class asyncutils._internal.types.SupportsMatMul¶
Bases:
ProtocolObjects that implement matrix multiplication to return an instance of its own type.
- __matmul__(other: Self, /) Self¶
- class asyncutils._internal.types.SupportsPop[T]¶
Bases:
ProtocolTypes with a
pop()method.- pop() T¶
- class asyncutils._internal.types.SupportsPopLeft[T]¶
Bases:
ProtocolTypes with a
popleft()method.- popleft() T¶
- class asyncutils._internal.types.SupportsSlicing[T]¶
Bases:
GenericSized[T],ProtocolProtocol for iterables with size, and index and slice access.
- __getitem__(idx: ValidSlice, /) Self¶
- __getitem__(idx: SupportsIndex, /) T
- __reversed__() collections.abc.Iterator[T]¶
The requirements for this protocol makes children automatically reversible.
- class asyncutils._internal.types.ToSyncFromLoopRV¶
Bases:
ProtocolThe signature of the return value of
util.to_sync_from_loop().- __call__[R, **P](
- f: collections.abc.Callable[P, collections.abc.Awaitable[R]],
- /,
- timeout: float | None = ...,
- class asyncutils._internal.types.TransientBlockFromLoopRV¶
Bases:
ProtocolThe signature of the return value of
util.transient_block_from_loop().- __call__[T, **P](f: collections.abc.Callable[P, T], /, *a: P, **k: P) asyncio.Future[T]¶
- class asyncutils._internal.types.WildcardType¶
Type of
channels.EventBus.WILDCARD.- __bool__() Literal[False]¶
- class asyncutils._internal.types.Writer[T]¶
Bases:
Protocolio.Writeris not used due to version compatibility issues.
- type asyncutils._internal.types.All = tuple[str, ...]¶
Type of the
__all__attributes of the submodules ofasyncutils.
- type asyncutils._internal.types.EveryMethodRV = Callable[[EveryMethodFT[T, R]], EveryMethodRVRV[T, R]]¶
Return type of
func.everymethod().
- type asyncutils._internal.types.ExcType = type[BaseException]¶
The type of
exc_typin :meth:~`object.__exit__` and__aexit__()methods.
- type asyncutils._internal.types.Exceptable = ExcType | tuple[ExcType, ...]¶
The type of objects that may follow an except statement.
- asyncutils._internal.types.ExceptionWrapper¶
The return type of
exceptions.wrap_exc().
- type asyncutils._internal.types.Executor = Literal['thread', 'process', 'interpreter', 'loky', 'loky_noreuse', 'dask', 'ipython', 'elib_flux_cluster', 'elib_flux_job', 'elib_slurm_cluster', 'elib_slurm_job', 'elib_single_node', 'pebble_thread', 'pebble_process', 'deadpool']¶
Type of strings representing executors that can be passed to -e/–executor.
- type asyncutils._internal.types.HashAlgorithm = Literal['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'blake2b', 'blake2s', 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', 'shake_128', 'shake_256']¶
Names of algorithms used for calculating checksums. The default is
context.MEMORY_MAPPED_IO_MANAGER_DEFAULT_CHECKSUM_ALG. The BLAKE2 family of algorithms, fast and somewhat secure with a low probability of collision, is the default choice.
- type asyncutils._internal.types.IntCompatible = str | SupportsInt | SupportsIndex | Buffer¶
Objects accepted by the
intconstructor.
- type asyncutils._internal.types.Middleware = Callable[[str, Any], Any]¶
Represents a middleware accepted by
EventBus.
- type asyncutils._internal.types.NonGroupExc = Intersection[BaseException, Not[BaseExceptionGroup]]¶
Exceptions that are not exception groups.
- type asyncutils._internal.types.Observer = Callable[Concatenate[Any, P], Awaitable[Any]]¶
The type of
channels.Observableobservers.
- type asyncutils._internal.types.OpenFiles = dict[tuple[TextIOWrapper[_WrappedBuffer], Literal['r+b', 'w+b', 'x+b']], MemoryMappedFile]¶
The type of the
io.MemoryMappedIOManager.open_filesproperty ofio.MemoryMappedIOManager.
- type asyncutils._internal.types.OpenRV = AbstractContextManager[MemoryMappedFile, None]¶
The type of the return values of the
open(),create()andcreate_sparsef()methods ofMemoryMappedIOManager.
- type asyncutils._internal.types.Openable = int | str | bytes | PathLike[str] | PathLike[bytes]¶
Anything that can normally be passed to the built-in
open()function.
- type asyncutils._internal.types.Proxy = FuncProxy[W] | FuncWrapper[W]¶
A supposed callable object having a
FuncWrapper.__wrapped__or__func__attribute pointing to the callable it wraps.
- type asyncutils._internal.types.RWLockCM = AbstractAsyncContextManager[None, None]¶
The type of the context managers returned by the
reader()andwriter()methods ofRWLockand subclasses thereof.
- type asyncutils._internal.types.Seek = Literal[0, 1, 2]¶
Possible values of the
whenceparameter forasyncutils.io.MemoryMappedIOManager.seek(), as follows:0:
SEEK_SET1:
SEEK_CUR2:
SEEK_END
- type asyncutils._internal.types.SigPatcherArg = tuple[Wrapper, str]¶
The type of a positional argument passed to a signature-patching function in
_internal.patch.
- type asyncutils._internal.types.SpecificSubscriber = Callable[[Any], Awaitable[object]]¶
The type of subscribers for
channels.EventBus.
- type asyncutils._internal.types.Submodule = Literal['altlocks', 'base', 'buckets', 'channels', 'cli', 'compete', 'config', 'console', 'constants', 'context', 'events', 'exceptions', 'func', 'futures', 'io', 'iterclasses', 'iters', 'locks', 'locksmiths', 'misc', 'mixins', 'networking', 'pools', 'processors', 'properties', 'queues', 'rwlocks', 'signals', 'tools', 'util', 'version']¶
Type of strings representing
asyncutilssubmodule names.
- type asyncutils._internal.types.SupportsIteration = Iterable[T] | AsyncIterable[T]¶
Objects that support (async) iteration.
- type asyncutils._internal.types.SupportsRichComparison = SupportsLT | SupportsGT¶
Objects implementing one of the operators < and >.
- type asyncutils._internal.types.Timer = Callable[[], float]¶
Type of functions that return the current time under some specification, such as
time.monotonic(),time.process_time()andtime.perf_counter().
- type asyncutils._internal.types.ValidSlice = slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None]¶
A slice with start, stop and step being integers or
None, representing a slice that typical sequences supporting slicing should accept.