[ENH]: Add TypedDict (like) type hints to rcParams · Issue #28222 · matplotlib/matplotlib · GitHub
Skip to content

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

Description

@dstansby

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions