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

Allow lambda with Void return #315

Merged
merged 2 commits into from
Jul 23, 2014
Merged

Conversation

etrepum
Copy link
Contributor

@etrepum etrepum commented Jul 22, 2014

Fixes #108

Not entirely sure this is the best way to go, but it passes the tests. Also, I don't understand the type of these visit_* methods. How do they return Type without any return statements?

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 23, 2014

The implementation is okay, though the lambda context check would be better in a utility method.

Currently the Python implicit None return is always accepted (i.e., a return statement is always optional). This probably a bad idea, and we should enforce an explicit return (potentially with a None return value). I added the issue #320 for this.

The visit_* methods are sloppy and should return an explicit None, though even this is somewhat sloppy... expressions and statements could plausibly have separate class hierarchies and visitors, but this would complicate the implementation of visitors that need to traverse arbitrary nodes.

JukkaL added a commit that referenced this pull request Jul 23, 2014
@JukkaL JukkaL merged commit 43aeba6 into python:master Jul 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lambda with void return value rejected
2 participants