You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Several
validphys.core
objects use a quick and dirtyTupleComp
base class to provide basic comparison functionality. Several of these classes outgrewnamestuple
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.
The text was updated successfully, but these errors were encountered: