Reading Python Objects Back
Unpack results returned by Python.
Results Come Back
When a Python function returns, you get a value back in Mojo. Knowing how to unpack it lets you use the result in your code. 📦
Always a PythonObject
Every Python call returns a PythonObject, Mojo's wrapper around whatever Python produced, be it a number, string, or array.
var total = np.sum(a)All lessons in this course
- Using NumPy from Mojo
- Passing Mojo Data to Python
- Reading Python Objects Back
- Interop Performance Gotchas