numpy / 1.22.0 / reference / generated / numpy.number.__class_getitem__.html /

numpy.number.__class_getitem__

method

number. __class_getitem__ ( item, / )

Return a parametrized wrapper around the number type.

New in version 1.22.

Returns
alias types.GenericAlias

A parametrized number type.

See also

PEP 585

Type hinting generics in standard collections.

Notes

This method is only available for python 3.9 and later.

Examples

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

© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.22/reference/generated/numpy.number.__class_getitem__.html