PPrevernal
Product

Product features · Prerelease identifier precedence

01

Check multi-digit numbers, shared prefixes and stable-release empty tuples, rejecting leading-zero numbers and invalid identifiers.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Prerelease identifier precedence

● ● ●Prevernal●
A concrete starting point · Prerelease identifier precedence ×
import re
IDENT = re.compile(r"[0-9A-Za-z-]+")
def prerelease_cmp(left, right):
    for item in (*left, *right):
        if not isinstance(item, str) or not IDENT.fullmatch(item):
            raise ValueError("identifier")
        if item.isascii() and item.isdigit() and len(item) > 1 and item[0] == "0":
            raise ValueError("leading zero")
    if not left or not right:
        return (not left) - (not right)
    for a, b in zip(left, right):
        if a == b: continue
        an, bn = a.isdigit(), b.isdigit()
        if an != bn: return -1 if an else 1
        if an and len(a) != len(b): return (len(a) > len(b)) - (len(a) < len(b))
        return (a > b) - (a < b)
    return (len(left) > len(right)) - (len(left) < len(right))
✳Compare already-separated prerelease identifiers with numeric identifiers below text identifiers.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗