summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBas van Beek <b.f.van.beek@vu.nl>2020-09-16 11:45:36 +0200
committerBas van Beek <b.f.van.beek@vu.nl>2020-10-01 13:56:27 +0200
commit97c221685fd4a8773bfe24e974a59cca6babf8c5 (patch)
tree08d3836a60f9b4ff64324981db5b3b4ff4626d18
parentda2a85480b7920b059f1cf0b82c2fe98ea798bee (diff)
downloadnumpy-97c221685fd4a8773bfe24e974a59cca6babf8c5.tar.gz
MAINT: Minor fixes; removed unused imports
-rw-r--r--numpy/core/_asarray.pyi28
1 files changed, 17 insertions, 11 deletions
diff --git a/numpy/core/_asarray.pyi b/numpy/core/_asarray.pyi
index 57081b760..5eb5dac36 100644
--- a/numpy/core/_asarray.pyi
+++ b/numpy/core/_asarray.pyi
@@ -1,5 +1,5 @@
import sys
-from typing import TypeVar, Optional, Union, Iterable, Tuple, overload
+from typing import TypeVar, Union, Iterable, overload
from numpy import ndarray, _OrderKACF
from numpy.typing import ArrayLike, DtypeLike
@@ -41,19 +41,17 @@ def asfortranarray(
a: object, dtype: DtypeLike = ..., *, like: ArrayLike = ...
) -> ndarray: ...
-_Requirements = Literal["F", "C", "A", "W", "O"]
-_E = Literal["E"]
+_Requirements = Literal[
+ "C", "C_CONTIGUOUS", "CONTIGUOUS",
+ "F", "F_CONTIGUOUS", "FORTRAN",
+ "A", "ALIGNED",
+ "W", "WRITEABLE",
+ "O", "OWNDATA"
+]
+_E = Literal["E", "ENSUREARRAY"]
@overload
def require(
- a: object,
- dtype: DtypeLike = ...,
- requirements: Union[_E, Iterable[Union[_E, _Requirements]]] = ...,
- *,
- like: ArrayLike = ...
-) -> ndarray: ...
-@overload
-def require(
a: _ArrayType,
dtype: None = ...,
requirements: Union[None, _Requirements, Iterable[_Requirements]] = ...,
@@ -64,6 +62,14 @@ def require(
def require(
a: object,
dtype: DtypeLike = ...,
+ requirements: Union[_E, Iterable[Union[_E, _Requirements]]] = ...,
+ *,
+ like: ArrayLike = ...
+) -> ndarray: ...
+@overload
+def require(
+ a: object,
+ dtype: DtypeLike = ...,
requirements: Union[None, _Requirements, Iterable[_Requirements]] = ...,
*,
like: ArrayLike = ...