There are ongoing issues with Pyodide where accessing Python objects from Javascript can cause them to not be garbage collected when they go out of scope.
I need to double check what the impacts of this are for us. But to summarize
When we call toJs it creates many PyProxys (particularly on deep objects)
These are not (!) automatically GC'ed and must be destroyed manually.
A fix may be coming for this in a later version of Pyodide - but for now, we should definitely fix it.
There are ongoing issues with Pyodide where accessing Python objects from Javascript can cause them to not be garbage collected when they go out of scope.
I need to double check what the impacts of this are for us. But to summarize
A fix may be coming for this in a later version of Pyodide - but for now, we should definitely fix it.