Skip to content

More patcher typing changes #111

@Miepee

Description

@Miepee

seems as good a time as any to leave my general feedback here:

  1. I strongly recommend using snake_case keys in the schema for better adherence to the python style guide in the generated TypedDict definitions
  2. the KEY_WHATEVER constants are an antipattern imo. using normal string literals will be better for basically everything. if you want to rename a key, rename it in the generated file with your IDE's rename function and then update the schema
  3. it's a bit surprising that so many keys in your schema aren't required. I find it's best to have as few optional fields as are necessary. I recommend using the ValidatorWithDefault tool we use in ODR, OPR, caver, etc. to automatically fill in defaults before validating the schema. then you can mark any field with a default as required and avoid messing around with get() and whatnot

Originally posted by @duncathan in #110 (review)

Additionally we shouldn't use string annotations of the explicit type, but instead use typing_extensions.Self.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions