Annotation Type Hints#

colour.hints

ArrayLike

alias of Union[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]], numpy._typing._nested_sequence._NestedSequence[numpy._typing._array_like._SupportsArray[numpy.dtype[Any]]], bool, int, float, complex, str, bytes, numpy._typing._nested_sequence._NestedSequence[Union[bool, int, float, complex, str, bytes]]]

NDArray

ndarray(shape, dtype=float, buffer=None, offset=0,

ModuleType

alias of module

Any(*args, **kwargs)

Special type indicating an unconstrained type.

Callable

Deprecated alias to collections.abc.Callable.

Dict

A generic version of dict.

Generator()

Iterable()

Iterator()

List

A generic version of list.

Literal

Special typing form to define literal types (a.k.a.

Mapping()

A Mapping is a generic container for associating key/value pairs.

NewType(name, tp)

NewType creates simple unique types with almost zero runtime overhead.

Optional

Optional[X] is equivalent to Union[X, None].

Protocol()

Base class for protocol classes.

Sequence()

All the operations on a read-only sequence.

SupportsIndex(*args, **kwargs)

An ABC with one abstract method __index__.

TYPE_CHECKING

bool(x) -> bool

TextIO()

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

Tuple

Deprecated alias to builtins.tuple.

Type

Deprecated alias to builtins.type.

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

Type variable.

TypedDict(typename[, fields, total])

A simple typed namespace.

Union

Union type; Union[X, Y] means either X or Y.

cast(typ, val)

Cast a value to a type.

overload(func)

Decorator for overloaded functions/methods.

runtime_checkable(cls)

Mark a protocol class as a runtime protocol.

Self

Used to spell the type of "self" in classes.

RegexFlag

NewType creates simple unique types with almost zero runtime overhead.

DTypeInt

alias of Union[numpy.int8, numpy.int16, numpy.int32, numpy.int64, numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64]

DTypeFloat

alias of Union[numpy.float16, numpy.float32, numpy.float64]

DTypeReal

alias of Union[numpy.int8, numpy.int16, numpy.int32, numpy.int64, numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64, numpy.float16, numpy.float32, numpy.float64]

DTypeComplex

alias of Union[numpy.complex64, numpy.complex128]

DTypeBoolean

alias of numpy.bool_

DType

alias of Union[numpy.bool_, numpy.int8, numpy.int16, numpy.int32, numpy.int64, numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64, numpy.float16, numpy.float32, numpy.float64, numpy.complex64, numpy.complex128]

Real

alias of Union[int, float]

Dataclass

alias of Any

NDArrayInt

ndarray(shape, dtype=float, buffer=None, offset=0,

NDArrayFloat

ndarray(shape, dtype=float, buffer=None, offset=0,

NDArrayReal

ndarray(shape, dtype=float, buffer=None, offset=0,

NDArrayComplex

ndarray(shape, dtype=float, buffer=None, offset=0,

NDArrayBoolean

ndarray(shape, dtype=float, buffer=None, offset=0,

NDArrayStr

ndarray(shape, dtype=float, buffer=None, offset=0,

ProtocolInterpolator(*args, **kwargs)

ProtocolExtrapolator(*args, **kwargs)

ProtocolLUTSequenceItem(*args, **kwargs)

LiteralWarning

alias of Literal['default', 'error', 'ignore', 'always', 'module', 'once']