Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Prev Previous commit
Next Next commit
fix doctest
  • Loading branch information
eendebakpt committed Jun 24, 2025
commit ba0501bdd1ab22e10e00442dbb6c01f3cf6d49a9
9 changes: 1 addition & 8 deletions numpy/typing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,7 @@
ndarray
~~~~~~~

It's possible (but deprecated) to mutate the dtype of an array at runtime. For example,
the following code is valid:

.. code-block:: python

>>> x = np.array([1, 2])
>>> x.dtype = np.bool

It's possible (but deprecated) to mutate the dtype of an array at runtime.
This sort of mutation is not allowed by the types. Users who want to
write statically typed code should instead use the `numpy.ndarray.view`
method to create a view of the array with a different dtype.
Expand Down
Loading