Skip to content

add lexicographic vers scheme #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

immqu
Copy link
Contributor

@immqu immqu commented Apr 3, 2025

Add a lexicographic versioning scheme which compares versions simply as strings
Addresses #265

@jkowalleck

This comment was marked as outdated.

@immqu

This comment was marked as resolved.

@jkowalleck
Copy link
Member

a generic versioning scheme that compares versions based on lexicographic order, interpreted as UTF-8.

is there a specification for this, or is it just UTF8 byte compare?

some UTF8 to play with

  • NUL -> \x00
  • 0 -> \x30
  • A -> \x41
  • a -> \x61
  • Ç -> \xc3\x87 (fourth letter in Turkish alphabet)
  • А -> \xd0\x90 (first letter of the Cyrillic alphabet)
  • 😃 -> \xf0\x9f\x98\x83

@johnmhoran johnmhoran added this to the 1.1 milestone Apr 4, 2025
@tschmidtb51
Copy link
Contributor

I would argue that it is strict byte comparison.
@immqu Could you please link the suggested implementation here?

@immqu
Copy link
Contributor Author

immqu commented Apr 11, 2025

I have updated it using byte comparison now: https://github.com/immqu/univers/blob/lexicographic-scheme/src/univers/versions.py#L149

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

Successfully merging this pull request may close these issues.

None yet

4 participants