Skip to content

Commit ca9aa54

Browse files
authored
Merge pull request #25973 from charris/backport-25971-25972
DOC: Backport gh-25971 and gh-25972
2 parents 0c54c6e + 7fe7561 commit ca9aa54

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

doc/source/reference/c-api/dtype.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ to the front of the integer name.
390390
This is the correct integer for lengths or indexing. In practice this is
391391
normally the size of a pointer, but this is not guaranteed.
392392

393-
..note::
393+
.. note::
394394
Before NumPy 2.0, this was the same as ``Py_intptr_t``.
395395
While a better match, this did not match actual usage in practice.
396396
On the Python side, we still support ``np.dtype('p')`` to fetch a dtype

numpy/ma/core.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from numpy import array as narray, expand_dims, iinfo, finfo
3838
from numpy._core.numeric import normalize_axis_tuple
3939
from numpy._utils._inspect import getargspec, formatargspec
40+
from numpy._utils import set_module
4041

4142

4243
__all__ = [
@@ -2636,7 +2637,7 @@ class MaskedIterator:
26362637
>>> x = np.ma.array(arange(6).reshape(2, 3))
26372638
>>> fl = x.flat
26382639
>>> type(fl)
2639-
<class 'numpy.ma.core.MaskedIterator'>
2640+
<class 'numpy.ma.MaskedIterator'>
26402641
>>> for item in fl:
26412642
... print(item)
26422643
...
@@ -2717,6 +2718,7 @@ def __next__(self):
27172718
return d
27182719

27192720

2721+
@set_module("numpy.ma")
27202722
class MaskedArray(ndarray):
27212723
"""
27222724
An array class with possibly masked values.
@@ -8378,7 +8380,7 @@ def asarray(a, dtype=None, order=None):
83788380
mask=False,
83798381
fill_value=1e+20)
83808382
>>> type(np.ma.asarray(x))
8381-
<class 'numpy.ma.core.MaskedArray'>
8383+
<class 'numpy.ma.MaskedArray'>
83828384
83838385
"""
83848386
order = order or 'C'
@@ -8425,7 +8427,7 @@ def asanyarray(a, dtype=None):
84258427
mask=False,
84268428
fill_value=1e+20)
84278429
>>> type(np.ma.asanyarray(x))
8428-
<class 'numpy.ma.core.MaskedArray'>
8430+
<class 'numpy.ma.MaskedArray'>
84298431
84308432
"""
84318433
# workaround for #8666, to preserve identity. Ideally the bottom line

0 commit comments

Comments
 (0)