numpy.number.__class_getitem__#

method

number.__class_getitem__(item, /)#

Return a parametrized wrapper around the number type.

在 1.22 版本加入.

Returns:
aliastypes.GenericAlias

A parametrized number type.

参见

PEP 585

Type hinting generics in standard collections.

Examples

>>> from typing import Any
>>> import numpy as np
>>> np.signedinteger[Any]
numpy.signedinteger[typing.Any]