summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-06-12 14:18:53 +0300
committerGitHub <noreply@github.com>2020-06-12 14:18:53 +0300
commit5345c2575a28fa2dfbbec83c99636669476c2745 (patch)
tree65b590d4ef7d573d8df663058a130a38b991da9f /numpy/core
parent9eabe2f87dbe087e878983bdd69edd8a9084c358 (diff)
parent8190116aa2fa58aba628b0a5cea768017acf82bf (diff)
downloadnumpy-5345c2575a28fa2dfbbec83c99636669476c2745.tar.gz
Merge pull request #16574 from person142/dtype-constructor-types
MAINT: fix name of first parameter to dtype constructor in type stubs
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/_add_newdocs.py4
-rw-r--r--numpy/core/tests/test_dtype.py6
2 files changed, 7 insertions, 3 deletions
diff --git a/numpy/core/_add_newdocs.py b/numpy/core/_add_newdocs.py
index 31585779b..d0ed3d381 100644
--- a/numpy/core/_add_newdocs.py
+++ b/numpy/core/_add_newdocs.py
@@ -5141,7 +5141,7 @@ add_newdoc('numpy.core', 'ufunc', ('at',
add_newdoc('numpy.core.multiarray', 'dtype',
"""
- dtype(obj, align=False, copy=False)
+ dtype(dtype, align=False, copy=False)
Create a data type object.
@@ -5151,7 +5151,7 @@ add_newdoc('numpy.core.multiarray', 'dtype',
Parameters
----------
- obj
+ dtype
Object to be converted to a data type object.
align : bool, optional
Add padding to the fields to match what a C compiler would output
diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py
index faea8688c..2e2b0dbe2 100644
--- a/numpy/core/tests/test_dtype.py
+++ b/numpy/core/tests/test_dtype.py
@@ -1056,6 +1056,11 @@ def test_invalid_dtype_string():
assert_raises(TypeError, np.dtype, u'Fl\xfcgel')
+def test_keyword_argument():
+ # test for https://github.com/numpy/numpy/pull/16574#issuecomment-642660971
+ assert np.dtype(dtype=np.float64) == np.dtype(np.float64)
+
+
class TestFromDTypeAttribute:
def test_simple(self):
class dt:
@@ -1333,4 +1338,3 @@ class TestFromCTypes:
pair_type = np.dtype('{},{}'.format(*pair))
expected = np.dtype([('f0', pair[0]), ('f1', pair[1])])
assert_equal(pair_type, expected)
-