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

Add a method for conditional deferral and use it in the new analyzer #6725

Closed
ilevkivskyi opened this issue Apr 26, 2019 · 1 comment
Closed
Labels
priority-1-normal refactoring Changing mypy's internals semantic-analyzer Problems that happen during semantic analysis topic-plugins The plugin API and ideas for new plugins

Comments

@ilevkivskyi
Copy link
Member

This idea appeared in #6724. It will be useful for plugins and in general to have something like this in SemanticAnalyzer:

def defer_if_possible(self) -> bool:
    if not self.final_iteration:
        self.defer()
        return True
    return False

Then it can be used like this:

if ctx.api.defer_if_possible():
    ...
else:
    ... # probably give some error

Maybe we can also add it to the old analyzer as always returning False, then we can completely hide the old vs new analyzer details in plugin API.

@JukkaL
Copy link
Collaborator

JukkaL commented Jul 5, 2019

process_placeholder is enough for now, as discussed in #7159.

@JukkaL JukkaL closed this as completed Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-1-normal refactoring Changing mypy's internals semantic-analyzer Problems that happen during semantic analysis topic-plugins The plugin API and ideas for new plugins
Projects
None yet
Development

No branches or pull requests

2 participants