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

Support reveal_type from dmypy #10510

Open
rowillia opened this issue May 19, 2021 · 0 comments
Open

Support reveal_type from dmypy #10510

rowillia opened this issue May 19, 2021 · 0 comments
Labels
feature topic-daemon dmypy topic-reveal-type reveal_type() and reveal_locals()

Comments

@rowillia
Copy link
Contributor

Feature

Support invoking reveal_type from dmypy (similar to suggest) to enable tooling to use mypy for type information.

Pitch

libCST is an extremely powerful tool for supporting refactoring Python code, and it has support for type information, but currently only supports Pyre:
https://libcst.readthedocs.io/en/latest/_modules/libcst/metadata/type_inference_provider.html#TypeInferenceProvider

Pyre and Mypy result in slightly different type information so I'd prefer to get our type data from mypy itself.

Existing solutions seem pretty janky -
https://github.com/fortana-co/sublime-mypy-reveal/blob/master/mypy_reveal.py#L72-L102 modifies the code and invokes reveal_type, https://github.com/matangover/mypy-vscode/blob/master/README.md#caveats imports mypy which isn't well supported.

@AlexWaygood AlexWaygood added the topic-reveal-type reveal_type() and reveal_locals() label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-daemon dmypy topic-reveal-type reveal_type() and reveal_locals()
Projects
None yet
Development

No branches or pull requests

3 participants