Skip to content

Mark Node types as Statements or Expressions #1785

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

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

rwbarton
Copy link
Contributor

@rwbarton rwbarton commented Jul 1, 2016

This doesn't actually do anything yet, as Statement and Expression are
just synonyms for Node. But it's part of the work that will need to be
done for #1783, and for now it serves as (unchecked) documentation.

This doesn't actually do anything yet, as Statement and Expression are
just synonyms for Node. But it's part of the work that will need to be
done for python#1783, and for now it serves as (unchecked) documentation.
@rwbarton
Copy link
Contributor Author

rwbarton commented Jul 1, 2016

I got about this far before determining that now is not really the best time to go ahead with this refactoring (#1783). Since this was a non-trivial amount of work to do, I put it in this form so that it could be merged now before doing the actual refactoring.

Locally I had some other (very rough) changes that tested these annotations to some extent, but mostly they should be considered untested for accuracy.

@rwbarton
Copy link
Contributor Author

rwbarton commented Jul 1, 2016

There are also some rough edges here; for example I marked Var as a Statement because it has an accept method and it isn't an Expression (the type checker doesn't give it a type), but of course it isn't really a statement either. Perhaps it needs its own category.

@gvanrossum gvanrossum merged commit baf2d78 into python:master Jul 1, 2016
@gvanrossum
Copy link
Member

Merging now as I have a branch where I'm adding more nodes and I might as well rebase before I get too far along. Thanks for this first pass!

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.

2 participants