REDROOM
PHP 8.0.30
Path:
Logout
Edit File
Size: 2.66 KB
Close
/opt/cloudlinux/venv/lib64/python3.11/site-packages/numpy/_typing/_nested_sequence.py
Text
Base64
"""A module containing the `_NestedSequence` protocol.""" from __future__ import annotations from collections.abc import Iterator from typing import ( Any, overload, TypeVar, Protocol, runtime_checkable, ) __all__ = ["_NestedSequence"] _T_co = TypeVar("_T_co", covariant=True) @runtime_checkable class _NestedSequence(Protocol[_T_co]): """A protocol for representing nested sequences. Warning ------- `_NestedSequence` currently does not work in combination with typevars, *e.g.* ``def func(a: _NestedSequnce[T]) -> T: ...``. See Also -------- collections.abc.Sequence ABCs for read-only and mutable :term:`sequences`. Examples -------- .. code-block:: python >>> from __future__ import annotations >>> from typing import TYPE_CHECKING >>> import numpy as np >>> from numpy._typing import _NestedSequence >>> def get_dtype(seq: _NestedSequence[float]) -> np.dtype[np.float64]: ... return np.asarray(seq).dtype >>> a = get_dtype([1.0]) >>> b = get_dtype([[1.0]]) >>> c = get_dtype([[[1.0]]]) >>> d = get_dtype([[[[1.0]]]]) >>> if TYPE_CHECKING: ... reveal_locals() ... # note: Revealed local types are: ... # note: a: numpy.dtype[numpy.floating[numpy._typing._64Bit]] ... # note: b: numpy.dtype[numpy.floating[numpy._typing._64Bit]] ... # note: c: numpy.dtype[numpy.floating[numpy._typing._64Bit]] ... # note: d: numpy.dtype[numpy.floating[numpy._typing._64Bit]] """ def __len__(self, /) -> int: """Implement ``len(self)``.""" raise NotImplementedError @overload def __getitem__(self, index: int, /) -> _T_co | _NestedSequence[_T_co]: ... @overload def __getitem__(self, index: slice, /) -> _NestedSequence[_T_co]: ... def __getitem__(self, index, /): """Implement ``self[x]``.""" raise NotImplementedError def __contains__(self, x: object, /) -> bool: """Implement ``x in self``.""" raise NotImplementedError def __iter__(self, /) -> Iterator[_T_co | _NestedSequence[_T_co]]: """Implement ``iter(self)``.""" raise NotImplementedError def __reversed__(self, /) -> Iterator[_T_co | _NestedSequence[_T_co]]: """Implement ``reversed(self)``.""" raise NotImplementedError def count(self, value: Any, /) -> int: """Return the number of occurrences of `value`.""" raise NotImplementedError def index(self, value: Any, /) -> int: """Return the first index of `value`.""" raise NotImplementedError
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
__pycache__
DIR
-
drwxr-xr-x
2026-07-22 02:20:04
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
setup.py
337 B
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_add_docstring.py
3.83 KB
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_array_like.py
4.14 KB
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_callable.pyi
10.86 KB
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_char_codes.py
5.78 KB
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_dtype_like.py
5.53 KB
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_extended_precision.py
777 B
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_nbit.py
345 B
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_nested_sequence.py
2.66 KB
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_scalars.py
980 B
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_shape.py
211 B
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
_ufunc.pyi
12.34 KB
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
6.84 KB
lrw-r--r--
2026-06-16 08:49:16
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).