Skip to content

Convert validphys.core objects to dataclasses #408

Open

Description

@Zaharid

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions