Skip to content

Use inheritance to allow most TypeVisitors not to deal with "synthetic" types#3204

Merged
JukkaL merged 4 commits intopython:masterfrom
sixolet:two-visitors
Apr 20, 2017
Merged

Use inheritance to allow most TypeVisitors not to deal with "synthetic" types#3204
JukkaL merged 4 commits intopython:masterfrom
sixolet:two-visitors

Conversation

@sixolet
Copy link
Copy Markdown
Collaborator

@sixolet sixolet commented Apr 20, 2017

This is a nearly-complete fix to #730 -- the trick is that some types aren't real, they're synthetic AST constructs, and so we shouldn't have to deal with those in every type visitor. Only the type visitors that deal with types before the synthetic constructs are analyzed away.

I added another synthetic type in a version of #2607 I am about to toss up, and this refactor made me only have to add a new handler to the relevant visitors, not every visitor ever. #2607 will now depend on this PR.

sixolet added 4 commits April 19, 2017 23:26
…c" types

This is a nearly-complete fix to python#730 --
the trick is that some types aren't real, they're synthetic AST constructs, and
so we shouldn't have to deal with those in every type visitor. Only the type
visitors that deal with types before the synthetic constructs are analyzed away.
Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks -- looks good! The simpler type visitors are nice.

@JukkaL JukkaL merged commit dde184f into python:master Apr 20, 2017
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