COVESA / COVESA/ifex

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

Open
#107 0 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Python
Stars
24
Forks
24
PR merge metrics
No merged PRs in 30d

Description

The implementation of [ifex_ast_construction.py](https://github.com/COVESA/ifex/blob/ifex_construction/ifex/model/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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading ifex/model/ifex_ast_construction.py, focusing on the dataclass constructors and their input checks. Compare that implementation with Python's dataclasses and typing support and relevant third-party options. Done means documenting whether a standard replacement exists and what custom implementation can be removed or changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.