Skip to content

Investigate a standard implementation of type-checking constructors for @dataclasses #107

@gunnar-mb

Description

@gunnar-mb

The implementation of ifex_ast_construction.py adds init() functions to dataclasses and those init functions also do some checks of the input parameters to ensure they are using the right data type.

Since @dataclass is such a fundamental concept in python, (and combined with the typing library, as it is here) I imagine this kind of type-validation might already be implemented in some 3rd-party library, or maybe even supported somehow by Python itself.

If anyone is aware, this is a ticket to see if there is already an existing / better implementation of it because I expect that there is!
In that case, we can simplify things by removing the custom implementation, and improving quality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions