Skip to content

Change TypedDict to standard class in most of the current code #35

Open
1 of 1 issue completed
Open

Description

@felixchenier

Problem statement

Keeping writable global variables in a module using a dictionary is good. But to type it and keep mypy happy, we need to use a class that derives from TypedDict. It's still good. But at this point, where we got the whole overhead of creating a class, it would be still better to simply use a real class. TypedDicts are great for data that is already in a dict form, such as JSON data. But general recommendations around the web are to start with a standard class (consider dataclasses) unless we have a reason to use a TypedDict.

Proposition

Use standard classes for GlobalVariables in the different modules.

New workflow

It's not really that much of a problem, mostly "code beauty".

Activity

  1. changed the title [-]Change TypedDict to dataclass in most of the current code[/-] [+]Change TypedDict to standard class in most of the current code[/+] on Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions