Skip to content

Prettier __str__ for Constructed Configs #14

@emann

Description

@emann

Is your feature request related to a problem? Please describe.
The default __repr__ for BaseModel is pretty ugly and it'd be nice to have a prettier way to print it out the values in a constructed config for debugging purposes and/or interactive applications.

Describe the solution you'd like
Make ConfigSchema an actual subclass of BaseModel and override the __str__ method which would call .dict() and then builds a string with each field/sub-field with the appropriate indentation.

Describe alternatives you've considered
In theory json.dumps or pydantic's built it .json() would work, but both have issues serializing much more than the basic built it types (it even struggles to do enums and paths).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions