This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / _typing / DTypeLike

TypeAliasType

numpy._typing:DTypeLike

source: /opt/hostedtoolcache/Python/3.14.5/x64/lib/python3.14/typing.py

Summary

Type alias.

Extended Summary

Type aliases are created through the type statement

type Alias = int

In this example, Alias and int will be treated equivalently by static type checkers.

At runtime, Alias is an instance of TypeAliasType. The __name__ attribute holds the name of the type alias. The value of the type alias is stored in the __value__ attribute. It is evaluated lazily, so the value is computed only if the attribute is accessed.

Type aliases can also be generic

type ListOrSet[T] = list[T] | set[T]

In this case, the type parameters of the alias are stored in the __type_params__ attribute.

See PEP 695 for more information.

Aliases

  • numpy.typing.DTypeLike