lupa
lupa copied to clipboard
how can pickle lua table
it's error when pickle.dumps(lupa.LuaRunTime().table(1,23)) how can pickle lua table??
You currently can't. Shouldn't be difficult to implement, though. I take pull requests.
The basic idea is to copy the data into a Python container (maybe a list of item tuples?) and pickle that. Anything that fails to pickle here (definitely any wrapped Lua objects) will simply make the pickling of the overall table fail. If every item can be converted to Python objects, the table will successfully pickle.
You may want to read up on the pickle protocol in the Python docs and how objects can implement it.