nnpdf icon indicating copy to clipboard operation
nnpdf copied to clipboard

Convert validphys.core objects to dataclasses

Open Zaharid opened this issue 6 years ago • 0 comments

Several validphys.core objects use a quick and dirty TupleComp base class to provide basic comparison functionality. Several of these classes outgrew namestuple at some point.

It works but it could be better. There is a nicer library solution in python 3.7 (and python 3.6 with an external library) which generates the various methods automatically, called dataclasses https://docs.python.org/3/library/dataclasses.html, which does that in a slightly nicer way. Using those for the objects in core would be a small win in maintainability and readability.

Zaharid avatar Mar 21 '19 18:03 Zaharid