Skip to content

bagof.hints

Reusable typing hints for Python projects.

Unpacked modules

Unpacked modules have all their symbols imported into the root module. For example, JSON can be accessed via bagof.hints.json.JSON or bagof.hints.JSON.

Lazy modules

Lazy modules (numpy, cupy, dask) are not imported by default, and importing them (or accessing them as bagof.hints.<name>) imports the corresponding array library. They stay importable when that library is absent.

Modules:

Name Description
array

Library-agnostic protocols for array-like objects.

builtin

Builtin types (such as builtin subsets of collections.abc).

collections

Protocols that are compatible with collections.abc.

flexi

Flexible "type-like" aliases for use in converters.

json

Types related to JSON (de)serialization.

strings

String-like objects.

typevars

Reusable TypeVars.

unpackable

Objects unpackable into keyword arguments.

numpy

Hints for numpy arrays and data types.

cupy

Hints for cupy arrays.

dask

Hints for [dask.array][] arrays.