lupa icon indicating copy to clipboard operation
lupa copied to clipboard

Print lua table representation of a table created from Python

Open Dimbreath opened this issue 5 years ago • 2 comments

I'm creating a simple table like this:

table = lua.table_from({'id': 0, 'name': 'name'})

Is it possible to print the lua table representation? I tried creating a lua function that would print() it but it only gives me the address of the table.

Dimbreath avatar Jan 03 '20 08:01 Dimbreath

Seems more of a Lua problem than a Lupa problem.

scoder avatar May 19 '20 12:05 scoder

I agree that _LuaTable could benefit from a nicer __repr__() implementation, though. As could some other objects like numbers. PR welcome that makes it return something like LuaTable({…}) and LuaNumber(123.4). Tests go into lupa.tests.test.

scoder avatar May 19 '20 12:05 scoder