Annotation Type Hints#

colour.hints

Any

Internal indicator of special typing constructs.

Callable

Callable type; Callable[[int], str] is a function of (int) -> str.

Dict

The central part of internal API.

Generator

The central part of internal API.

Iterable

The central part of internal API.

Iterator

The central part of internal API.

List

The central part of internal API.

Mapping

The central part of internal API.

ModuleType

alias of module

Optional

Internal indicator of special typing constructs.

Union

Internal indicator of special typing constructs.

Sequence

The central part of internal API.

SupportsIndex(*args, **kwargs)

An ABC with one abstract method __index__.

TextIO(*args, **kwds)

Typed version of the return of open() in text mode.

Tuple

Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

Type

A special construct usable to annotate class objects.

TypedDict(typename[, fields, total])

A simple typed namespace.

TypeVar(name, *constraints[, bound, ...])

Type variable.

RegexFlag(x)

DTypeBoolean

alias of bool_

DTypeInteger

The central part of internal API.

DTypeFloating

The central part of internal API.

DTypeNumber

The central part of internal API.

DTypeComplex

The central part of internal API.

DType

The central part of internal API.

Integer

alias of int

Floating

alias of float

Number

The central part of internal API.

Complex

alias of complex

Boolean

alias of bool

Literal

Internal indicator of special typing constructs.

Dataclass

Internal indicator of special typing constructs.

NestedSequence

Internal indicator of special typing constructs.

ArrayLike

The central part of internal API.

IntegerOrArrayLike

The central part of internal API.

FloatingOrArrayLike

The central part of internal API.

NumberOrArrayLike

The central part of internal API.

ComplexOrArrayLike

The central part of internal API.

BooleanOrArrayLike

The central part of internal API.

ScalarType

alias of TypeVar('ScalarType', bound=generic, covariant=True)

StrOrArrayLike

The central part of internal API.

NDArray

alias of ndarray

IntegerOrNDArray

The central part of internal API.

FloatingOrNDArray

The central part of internal API.

NumberOrNDArray

The central part of internal API.

ComplexOrNDArray

The central part of internal API.

BooleanOrNDArray

The central part of internal API.

StrOrNDArray

The central part of internal API.

TypeInterpolator(*args, **kwargs)

TypeExtrapolator(*args, **kwargs)

TypeLUTSequenceItem(*args, **kwargs)

LiteralWarning

The central part of internal API.

cast(typ, val)

Cast a value to a type.