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

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

Merged
merged 4 commits into from
Apr 20, 2017

Conversation

sixolet
Copy link
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.

…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
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