hints

all type hints

All type hints from the maci library and third-party libraries are accessible through the "hint" module to annotate unique or custom data types. Placing them in one location aims to provide a simple way of finding the desired unique types you need to annotate.

path name convention

The hint path name convention contains 3-parts and ensures simplicity in locating the data type. Here is the convention and how to break it down:

Example data type name: maci.hint.DataType

  • maci is the top-level module name.

  • hint is a submodule of maci, which contains definitions of various data type classes.

  • DataType is the class name of the specific data type.

type hint usage

Example of using the MaciDataObj type to annotate a variable and function

# variable
maci_obj: maci.hint.MaciDataObj = maci.build()

# function
def fn(data: maci.hint.MaciDataObj) -> maci.hint.MaciDataObj:
    ...

Note: There are other types available in the "hint" module for thin wrapper api functions used like xml, ini, etc,.

Last updated