numpy.dtype.__class_getitem__#

方法

dtype.__class_getitem__(item, /)#

返回 dtype 型別的參數化包裝器。

在 1.22 版本中新增。

回傳值:
aliastypes.GenericAlias

一個參數化的 dtype 型別。

另請參閱

PEP 585

標準集合中的型別提示泛型。

範例

>>> import numpy as np
>>> np.dtype[np.int64]
numpy.dtype[numpy.int64]