Implement Lua operator overloading for wrapped Python objects
Lua objects support operator overloading in their metatable:
http://www.lua.org/manual/5.3/manual.html#2.4
Mapping the Lua arithmetic etc. operators for wrapped Python objects to the equivalent Python operators should provide a much better user experience.
This also needs some kind of security support. Either through the normal attribute access intercept (which would have to check for special methods anyway), or through a separate set of explicitly allowed operators. Maybe both: explicitly allowed operators are fast, the rest goes through the special attribute lookup.
Is there a way to do this at all right now?
Is there a way to do this at all right now?
You can probably set up a metatable from Lua-side, so yes, it can be done, I think. Would just be substantially nicer to have it done automatically, since all the introspection capabilities are there.