Skip to content

Mark Node types as Statements or Expressions - #1785

Merged
gvanrossum merged 1 commit into
python:masterfrom
rwbarton:rwbarton-expression
Jul 1, 2016
Merged

gvanrossum merged 1 commit into
python:masterfrom
rwbarton:rwbarton-expression

Conversation

@rwbarton

@rwbarton rwbarton commented Jul 1, 2016

Copy link
Copy Markdown
Contributor

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

rwbarton commented Jul 1, 2016

Copy link
Copy Markdown
Contributor Author

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

rwbarton commented Jul 1, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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