Marimo's print routing breaks Numba compilation In notebooks that do not use mo.Thread,…
- User
Marimo's print routing breaks Numba compilation
In notebooks that do not use
mo.Thread,printmust retain builtin identity so Numba can compile functions that call it.mo.Threadmust continue routing output to the spawning cell, with output isolation between concurrent threads.Interface
No new interfaces are introduced.
- Assistant
Now update
kernel_lifecycle.py— remove theprint_override_fnfield and its use: - Assistant
Now
runtime.py: - Assistant
Now the core change — install the override lazily in
Thread.__init__: - Assistant
Now update the
print_overridedocstring to reflect the new contract: - Assistant
Now the test helper:
- Assistant
Check for any remaining references:
- Assistant
Now add tests to
tests/_runtime/test_threads.py: - Assistant
Now run the tests:
- Assistant
This failure is unrelated (missing built frontend assets). Confirm it fails without my changes:
- Assistant
Pre-existing failure, unrelated. Now run the wider runtime suite and type/lint checks:
- Assistant
My inspection line broke (messages are bytes). Retry the repro more simply:
- Assistant
Bug confirmed on clean tree, fixed with the change. Final sweep over the messaging suite:
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.