Skip to content

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

Open

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

  1. story645 commented on May 14, 2024

    @story645
    Member

    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

  2. cesaryuan commented on May 14, 2024

    @cesaryuan
    Contributor

    It seems there already are.
    image

  3. cesaryuan commented on May 14, 2024

    @cesaryuan
    Contributor

    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

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