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

[ENH]: Add TypedDict (like) type hints to rcParams #28222

Open
dstansby opened this issue May 14, 2024 · 3 comments
Open

[ENH]: Add TypedDict (like) type hints to rcParams #28222

dstansby opened this issue May 14, 2024 · 3 comments

Comments

@dstansby
Copy link
Member

Problem

In Python 3.8, typing.TypedDict was added to represent dictionary objects with a specific set of keys: https://typing.readthedocs.io/en/latest/spec/typeddict.html#typeddict. Using a TypedDict allows code editors (in my case VSCode) to offer autocomplete suggestions for keys.

It would be super useful for rcParams if one could e.g., type rcParams["font and get autocomplete suggestions for all the font keys.

This is what it an example looks like in VSCode:
Screenshot 2024-05-14 at 08 58 07

Proposed solution

No response

@story645
Copy link
Member

story645 commented May 14, 2024

Um, this is probably a good idea, give or take #25617, but for your specific use case there's maybe also https://github.com/yy0931/vscode-mplstyle

@cesaryuan
Copy link

It seems there already are.
image

@cesaryuan
Copy link

cesaryuan commented May 14, 2024

Off topic, you can also try https://github.com/yy0931/vscode-mplstyle

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants