Skip to content
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

Class properties return NoneType instead of nil #2

Closed
vishnevskiy opened this issue Feb 28, 2011 · 2 comments
Closed

Class properties return NoneType instead of nil #2

vishnevskiy opened this issue Feb 28, 2011 · 2 comments
Labels

Comments

@vishnevskiy
Copy link

If a class property such as

@property
def my_fn(self):
    return None

Is access via Lua and the return is None then you get None itself rather than nil.

@scoder
Copy link
Owner

scoder commented Jul 24, 2011

The handling of "nil" in Lua is not always obvious. In some cases, nil has a special meaning, so returning nil from Lupa can be ambiguous and may prevent users from figuring out what has actually happened (is it an error case or did someone return None or nil on purpose?)

I admit that the cases where Lupa returns either None or nil are not all thoroughly thought out. It's worth some more investigation. Any help is appreciated.

@scoder scoder added fixed and removed incomplete labels Oct 11, 2014
@scoder
Copy link
Owner

scoder commented Oct 11, 2014

None/nil handling has been redone in Lupa 1.0.

@scoder scoder closed this as completed Oct 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants