summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorJosh Wilson <person142@users.noreply.github.com>2020-06-10 21:29:45 -0700
committerJosh Wilson <person142@users.noreply.github.com>2020-06-10 21:31:23 -0700
commit4df89d13e64c23205504cebe25750fade41e2daa (patch)
tree9167d5a4ffe4dd0fcc34790a4efac75fe7888117 /numpy
parent68ebc2bad1ad6a99e9939eff205a1a6d936cf4fd (diff)
downloadnumpy-4df89d13e64c23205504cebe25750fade41e2daa.tar.gz
MAINT: fix name of first parameter to dtype constructor in type stubs
The first parameter to the constructor is currently called "obj", which is incorrect. It should instead be "dtype".
Diffstat (limited to 'numpy')
-rw-r--r--numpy/__init__.pyi7
-rw-r--r--numpy/tests/typing/pass/dtype.py3
2 files changed, 9 insertions, 1 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index 2e9c28821..4aab0bbfa 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -51,7 +51,12 @@ _NdArraySubClass = TypeVar("_NdArraySubClass", bound=ndarray)
class dtype:
names: Optional[Tuple[str, ...]]
- def __init__(self, obj: DtypeLike, align: bool = ..., copy: bool = ...) -> None: ...
+ def __init__(
+ self,
+ dtype: DtypeLike,
+ align: bool = ...,
+ copy: bool = ...,
+ ) -> None: ...
def __eq__(self, other: DtypeLike) -> bool: ...
def __ne__(self, other: DtypeLike) -> bool: ...
def __gt__(self, other: DtypeLike) -> bool: ...
diff --git a/numpy/tests/typing/pass/dtype.py b/numpy/tests/typing/pass/dtype.py
new file mode 100644
index 000000000..f954fdd44
--- /dev/null
+++ b/numpy/tests/typing/pass/dtype.py
@@ -0,0 +1,3 @@
+import numpy as np
+
+np.dtype(dtype=np.int64)