diff options
Diffstat (limited to '.venv/lib/python3.12/site-packages/numpy/core/_asarray.pyi')
-rw-r--r-- | .venv/lib/python3.12/site-packages/numpy/core/_asarray.pyi | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/numpy/core/_asarray.pyi b/.venv/lib/python3.12/site-packages/numpy/core/_asarray.pyi new file mode 100644 index 00000000..69d1528d --- /dev/null +++ b/.venv/lib/python3.12/site-packages/numpy/core/_asarray.pyi @@ -0,0 +1,42 @@ +from collections.abc import Iterable +from typing import Any, TypeVar, Union, overload, Literal + +from numpy import ndarray +from numpy._typing import DTypeLike, _SupportsArrayFunc + +_ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any]) + +_Requirements = Literal[ + "C", "C_CONTIGUOUS", "CONTIGUOUS", + "F", "F_CONTIGUOUS", "FORTRAN", + "A", "ALIGNED", + "W", "WRITEABLE", + "O", "OWNDATA" +] +_E = Literal["E", "ENSUREARRAY"] +_RequirementsWithE = Union[_Requirements, _E] + +@overload +def require( + a: _ArrayType, + dtype: None = ..., + requirements: None | _Requirements | Iterable[_Requirements] = ..., + *, + like: _SupportsArrayFunc = ... +) -> _ArrayType: ... +@overload +def require( + a: object, + dtype: DTypeLike = ..., + requirements: _E | Iterable[_RequirementsWithE] = ..., + *, + like: _SupportsArrayFunc = ... +) -> ndarray[Any, Any]: ... +@overload +def require( + a: object, + dtype: DTypeLike = ..., + requirements: None | _Requirements | Iterable[_Requirements] = ..., + *, + like: _SupportsArrayFunc = ... +) -> ndarray[Any, Any]: ... |