-
Notifications
You must be signed in to change notification settings - Fork 82
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
in operator has non predictable behavior #16
Comments
It looks to me that 'in' is being implemented by iterating over the table. So:
On Mon, Jul 1, 2013 at 4:09 PM, benmercs notifications@github.com wrote:
|
The main problem, is that LuaObject's iterator is acting like a "singleton" for that instance of the variable. You'll find that you can't get 2 separate iterators pointing to different positions in LuaObject since behind the scenes, only one iterator state is being maintained and you always get back that state. I was looking at trying to get |
@greatwolf I discovered and fixed this problem My fork of this project though entirely dirente, had the same problem. I was able to resolve using the code set: From line https://github.com/alexsilva/lunatic-python/blob/dev-wsgi/src/luainpython.c#L226 My tests are simple but prove that the problem is resolved: https://github.com/alexsilva/lunatic-python/blob/master/tests/python/test.py#L102 |
It seems the 'in' Python operator has non predictable behavior on Lua tables:
results in
I guess this should be either
True
orFalse
, but not both.In addition, if I ask for "d" instead, it's always
False
.The text was updated successfully, but these errors were encountered: