Nemotron 3 Ultra read the diff and named the assumptions the change makes. Nothing here is trusted: each attack only counts through the counterexamples below.
A1The fast‑path guard assumes that a version lacking the indicator characters contains only ASCII digits and dots, so it splits on '.' and feeds each piece to int().
base: The old __init__ falls through to the full regex (self._regex.fullmatch). The pattern does not allow whitespace between the dot and the digits, so the match fails and InvalidVersion is raised.; head: The fast‑path executes: version.strip().split('.') yields pieces like '1 ' and '2'; int() accepts the surrounding whitespace, so a Version object is created with release=(1, 2).
Inputs: versions with spaces adjacent to the dot separator · e.g. Version("1 .2"), Version("1. 2") · Lightning strategies: 3/4 valid, 2 hits
A2The fast‑path guard assumes that any string lacking the indicator characters consists only of ASCII digits and dots, so int() will only ever see ASCII digits.
base: `Version("1.2")` falls through to the regex path; `VERSION_PATTERN` uses `[0-9]` which matches only ASCII digits, so the fullmatch fails and `InvalidVersion` is raised.; head: The fast‑path is taken, `version.strip().split(".")` yields `["1", "2"]`; `int()` accepts Unicode decimal digits, producing `(1, 2)`. A `Version` instance is created with `release=(1, 2)` and no exception.
Inputs: PEP‑440‑like release segment written with non‑ASCII decimal digits · e.g. Version("1.2") · Lightning strategies: 3/4 valid, 1 hits
A3The fast‑path assumes `int()` only accepts ASCII decimal digits; it treats any string without the indicator characters as a simple numeric version.
base: The regex `VERSION_PATTERN` only matches ASCII `[0-9]` in the release segment, so `Version("١.٢.٣")` raises `InvalidVersion`.; head: The fast‑path runs `version.strip().split('.')` and `map(int, …)`. `int()` accepts Unicode decimal digits, so the version is accepted and normalized to `(1, 2, 3)`.
Inputs: non‑ASCII decimal digits (Arabic‑Indic) · e.g. Version("١.٢.٣") · Lightning strategies: 3/4 valid, 2 hits
A4The fast‑path guard assumes that a version without indicator characters consists solely of ASCII decimal digits, but int() also accepts any Unicode decimal digit.
base: The regex uses [0-9] for the release segment, which matches only ASCII digits; the fullmatch fails and InvalidVersion is raised.; head: The fast‑path splits on '.' and calls int() on each segment; int() accepts full‑width digits (e.g. U+FF11), so a Version object is created with release=(1, 2).
Inputs: versions written with non‑ASCII decimal digits · e.g. Version("1.2"), Version("123.456") · Lightning strategies: 2/4 valid, 0 hits
A5The fast‑path guard assumes that a string without indicator characters contains no whitespace inside the release segment.
base: Regex `\s*` only permits leading/trailing whitespace; the pattern for `release` (`[0-9]+(?:\.[0-9]+)*`) does not allow a space between a digit and a dot, so `fullmatch` fails and `InvalidVersion` is raised.; head: Fast‑path executes; `strip()` removes only leading/trailing whitespace, `split(".")` gives `["1 ", "2"]`; `int("1 ")` succeeds (int ignores surrounding whitespace), producing `release=(1, 2)`. A `Version` instance is returned.
Inputs: Release segment with ASCII whitespace around the dot separator · e.g. Version("1 .2"), Version("1. 2") · Lightning strategies: 3/4 valid, 1 hits