Open
Description
Hi,
The following code fails with TypeError: __eq__() missing 1 required positional argument: 'rhs'
import lupa
lua = lupa.LuaRuntime(unpack_returned_tuples=True)
class foo:
def __init__(self):
self.a = 1
def __eq__(self, rhs):
return self.a==rhs.a
def __hash__(self) :
return hash(self.a)
f1 = foo()
f2 = foo()
lua.execute('f1 = python.eval("f1")')
lua.execute('f2 = python.eval("f2")')
print(f1==f2) # prints 'True' (correct)
lua.execute('print(f1==f2)') # prints 'false' (wrong)
lua.execute('print(f1.__eq__(f2))') # prints 'true' (correct)
lua.execute('print(f1.__eq__(f1))') # fails
Is it a bug or am I missing something?
Python 3.8.2, Lupa 1.9
Thanks