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
{{ message }}
Repository navigation
Provide Public API to normalize version parts #1067
This is actually reasonable that project management utilities would want to be able to normalize part of a version such as the pre or post-release part without needing or wanting to construct a whole version.
It is even useful for interacting with the __replace__ API which currently only takes the normalized pre-release parts, so you need to normalize them before passing them in.
I have not thought out what a good public API would look like, we could simply make private functions public, or there may be a better approach.
Would it make sense to either have .replace, which is .__replace__ but with added normalization, or even add normalization to .__replace__, and provide .replace_unchecked (or something like that) if we need a fast path? The normalization might be pretty light weight?
Activity
henryiii commentedon Jan 23, 2026
Would it make sense to either have
.replace, which is.__replace__but with added normalization, or even add normalization to.__replace__, and provide.replace_unchecked(or something like that) if we need a fast path? The normalization might be pretty light weight?notatallshaw commentedon Jan 24, 2026
If that would remove the need to call
_parse_letter_versiondirectly, sure.When I first opened the PR for replace I was intentionally limited on normalization until there was a required use case, but perhaps this is that.