Skip to content

Commit 49f5358

Browse files
author
Bas van Beek
committed
DOC: Add a release note for __class_getitem__
1 parent d9f11f2 commit 49f5358

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
``ndarray``, ``dtype`` and ``number`` are now runtime-subscriptable
2+
-------------------------------------------------------------------
3+
Mimicking :pep:`585`, the `~numpy.ndarray`, `~numpy.dtype` and `~numpy.number`
4+
classes are now subscriptable for python 3.9 and later.
5+
Consequently, expressions that were previously only allowed in .pyi stub files
6+
or with the help of ``from __future__ import annotations`` are now also legal
7+
during runtime.
8+
9+
.. code-block:: python
10+
11+
>>> import numpy as np
12+
>>> from typing import Any
13+
14+
>>> np.ndarray[Any, np.dtype[np.float64]]
15+
numpy.ndarray[typing.Any, numpy.dtype[numpy.float64]]

0 commit comments

Comments
 (0)