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 new_typeinfo to public plugin API for both SemanticAnalyzer and TypeChecker #8257

Open
mkurnikov opened this issue Jan 7, 2020 · 1 comment
Labels
topic-plugins The plugin API and ideas for new plugins

Comments

@mkurnikov
Copy link
Contributor

In django-stubs, it's used in a lot of places to generate one-off classes.

For semanal, there's https://github.com/python/mypy/blob/master/mypy/semanal.py#L3029, which used for the special casing of NamedTuple/TypedDict/others, which basically plugins in the core.

For type checking, there's no equivalent, but similar code is used here https://github.com/python/mypy/blob/master/mypy/checker.py#L3659

It would be also nice to be able to specify more than one base class.

@msullivan
Copy link
Collaborator

Adding something to the plugin API for semantic analyzers is definitely in scope, if you want to submit a PR.

Typechecking is a little less clear. I think that callable hack might have a bad interaction with the daemon that just doesn't come up much, but if we generate more classes at typecheck time it would.

@JelleZijlstra JelleZijlstra added the topic-plugins The plugin API and ideas for new plugins label Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-plugins The plugin API and ideas for new plugins
Projects
None yet
Development

No branches or pull requests

3 participants