You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When runtime encoding is None, lua.table(foo=132) creates a Lua table with userdata as a key. There is a workaround (use lua.table_from which supports dicts with binary keys). But I think it makes more sense to use Lua strings for keys for tables created by lua.table, even if the encoding is None. I expect this to work even if encoding is None:
fromlupaimportLuaRuntimelua=LuaRuntime(encoding=None)
tbl=lua.table(x=1)
# this should print 1, but it prints 'nil'lua.eval("function(tbl) print(type(tbl.x)) end")(tbl)
# this prints# userdata numberlua.eval("function(tbl) for k,v in pairs(tbl) do print(type(k),type(v)) end end")(tbl)
The text was updated successfully, but these errors were encountered:
When runtime encoding is None,
lua.table(foo=132)
creates a Lua table with userdata as a key. There is a workaround (uselua.table_from
which supports dicts with binary keys). But I think it makes more sense to use Lua strings for keys for tables created bylua.table
, even if the encoding is None. I expect this to work even if encoding is None:The text was updated successfully, but these errors were encountered: