The Mojo ManualXYZ Homework Edition

⇩ Download ▾

10.1 Python interoperability

Not only does Mojo use a Pythonic syntax, our plan is to provide full compatibility with the Python ecosystem. There are two types of compatibility (or interoperability) that we support:

Diagram: images python python interop
into Python and a Python program calls into a Mojo module.

By embracing both directions of language interoperability, you can choose how to use Mojo with Python in a way that works best for your use case.

To learn more about bridging Python ↔ Mojo, continue reading:

Adapted from the Mojo Manual, part of the Modular Platform repository (github.com/modular/modular), Copyright (c) Modular Inc., licensed under the Apache License v2.0 with LLVM Exceptions. Changes were made: reformatted as an accessible XYZ web edition with build-verified example outputs. Mojo is a trademark of Modular Inc.; this edition is not affiliated with or endorsed by Modular. License: Apache-2.0 WITH LLVM-exception.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.