Skip to content

version string representation is missing type information #17

Description

@Hritik14
>>> from univers.versions import SemverVersion
>>> SemverVersion("2.0.0")
SemverVersion(string='2.0.0')
>>> str(SemverVersion("2.0.0"))
'2.0.0'

After converting a Version to string, it is impossible to switch back as the type (SemverVersion) information is lost. This will cause problems when saving and retrieving versions from a database.

One possible solution is to store the class name SemverVersion and the string representation both in the database.
Even so, would it make sense to have a vers like (but tiny) specification for versions ?
It could be something along the lines

ver:SemverVersion/2.0.0

I'm not even sure if this representation is required at all, comments please.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions