Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can pickle lua table #50

Open
joijuke opened this issue Apr 24, 2015 · 2 comments
Open

how can pickle lua table #50

joijuke opened this issue Apr 24, 2015 · 2 comments

Comments

@joijuke
Copy link

joijuke commented Apr 24, 2015

it's error when pickle.dumps(lupa.LuaRunTime().table(1,23))
how can pickle lua table??

@scoder
Copy link
Owner

scoder commented Apr 24, 2015

You currently can't. Shouldn't be difficult to implement, though. I take pull requests.

@scoder
Copy link
Owner

scoder commented Apr 24, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants