Skip to content

optype.typing

Any* type aliases

Type aliases for anything that can always be passed to int, float, complex, iter, or typing.Literal

Python constructor optype.typing alias
int(_) AnyInt
float(_) AnyFloat
complex(_) AnyComplex
iter(_) AnyIterable
typing.Literal[_] AnyLiteral

Note

Even though some str and bytes can be converted to int, float, complex, most of them can't, and are therefore not included in these type aliases.

Empty* type aliases

These are builtin types or collections that are empty, i.e. have length 0 or yield no elements.

instance optype.typing type
'' EmptyString
b'' EmptyBytes
() EmptyTuple
[] EmptyList
{} EmptyDict
set() EmptySet
(i for i in range(0)) EmptyIterable

Literal types

Literal values optype.typing type Notes
{False, True} LiteralBool Similar to typing.LiteralString, but for bool.
{0, 1, ..., 255} LiteralByte Integers in the range 0-255, that make up a bytes or bytearray objects.