Skip to main content

Mojo module

bindings

Aliases

MOJO_PYTHON_TYPE_OBJECTS

alias MOJO_PYTHON_TYPE_OBJECTS = _Global[__init__[__mlir_type.!kgen.string]("MOJO_PYTHON_TYPE_OBJECTS"), Dict[StringSlice[StaticConstantOrigin], PythonObject], Dict[StringSlice[StaticConstantOrigin], PythonObject]]

Mapping of Mojo type identifiers to unique PyTypeObject* binding that Mojo type to this CPython interpreter instance.

PyFunction

alias PyFunction = fn(mut PythonObject, mut PythonObject) -> PythonObject

The generic function type for non-raising Python bindings.

The first argument is the self object, and the second argument is a tuple of the positional arguments. These functions always return a Python object (could be a None object).

PyFunctionRaising

alias PyFunctionRaising = fn(mut PythonObject, mut PythonObject) raises -> PythonObject

The generic function type for raising Python bindings.

The first argument is the self object, and the second argument is a tuple of the positional arguments. These functions always return a Python object (could be a None object).

Structs

Functions

Was this page helpful?