summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Wilson <person142@users.noreply.github.com>2020-06-11 20:59:35 -0700
committerJosh Wilson <person142@users.noreply.github.com>2020-06-11 20:59:35 -0700
commit8190116aa2fa58aba628b0a5cea768017acf82bf (patch)
tree355ae88b2ec707a2b01084238779824194efaaf1
parent4df89d13e64c23205504cebe25750fade41e2daa (diff)
downloadnumpy-8190116aa2fa58aba628b0a5cea768017acf82bf.tar.gz
DOC: correct name of first dtype constructor parameter
-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 688238af3..c6c724ab3 100644
--- a/numpy/core/_add_newdocs.py
+++ b/numpy/core/_add_newdocs.py
@@ -5142,7 +5142,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.
@@ -5152,7 +5152,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)
-