Skip to content

Tidy up with LabThingsRootModelWrapper #270

@rwb27

Description

@rwb27

wrap_plain_types_in_rootmodel now uses a subclass called LabThingsRootModelWrapper to make it explicit when things have been wrapped, and thus to make it easier to unwrap them. It would be worth looking through the code and checking the various places where that function is used to see if we can simplify the code.

Also, I think it would be possible to type hint wrap_plain_types_in_rootmodel such that it's clear to mypy that the return value is either type[Value] or type[RootModel[Value]]. That would make mypy super happy in certain places.

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