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 assumes the version string contains only ASCII digits and dots, so it strips leading/trailing whitespace before parsing.
base: The original regex‑based parser (`_regex.fullmatch(version)`) is anchored (`^…$`) and does not allow surrounding whitespace, so it raises `InvalidVersion`.; head: The new fast‑path accepts the stripped string, builds a Version object with epoch 0, release tuple, and no pre/post/dev/local parts, and returns normally.
Inputs: Version strings that are a valid simple numeric dotted version surrounded by leading/trailing ASCII whitespace. · e.g. Version(" 1.2.3 "), Version("\t1.0.0\n") · Lightning strategies: 3/4 valid, 0 hits
A2The fast‑path assumes a simple numeric version never has trailing zero components, so it skips the normal trailing‑zero stripping logic.
base: Version("1.0.0").release == (1,) and str(Version("1.0.0")) == "1.0".; head: Version("1.0.0").release == (1, 0, 0) and str(Version("1.0.0")) == "1.0.0".
Inputs: numeric dot‑only versions with trailing zero components · e.g. Version("1.0.0"), Version("2.0.0.0"), Version("0.0") · Lightning strategies: 2/4 valid, 0 hits
A3The fast‑path assumes that surrounding whitespace is harmless because it strips the string before parsing, while the original regex validates the raw string.
base: Version(" 1.2.3 ") raises `InvalidVersion` because the original regex does a fullmatch on the raw string containing spaces.; head: Version(" 1.2.3 ") is accepted; the fast‑path strips whitespace, splits on '.', converts each part to int, stores epoch=0, pre/post/dev/local=None and returns a valid Version object.
Inputs: whitespace‑padded numeric version · e.g. Version(" 1.2.3 "), Version("\t1.2.3\n") · Lightning strategies: 3/4 valid, 1 hits
A4The fast‑path assumes the version string contains only ASCII digits and dots, so it strips any Unicode whitespace characters before parsing.
base: The original regex does not recognise Unicode whitespace as part of the version pattern, so `fullmatch` fails and `InvalidVersion` is raised.; head: The fast‑path creates a Version object from the stripped numeric dotted string, treating it as a valid simple version.
Inputs: Version strings that are a valid simple numeric dotted version surrounded by leading/trailing Unicode whitespace. · e.g. Version(" 1.2.3 ") · Lightning strategies: 4/4 valid, 1 hits
A5The fast‑path assumes numeric dot‑only versions are already in normalized form, so it omits the trailing‑zero stripping step.
base: Version("3.2.0").release == (3, 2) and str(Version("3.2.0")) == "3.2".; head: Version("3.2.0").release == (3, 2, 0) and str(Version("3.2.0")) == "3.2.0".
Inputs: numeric dot‑only versions ending with one or more zero components · e.g. Version("3.2.0"), Version("10.0"), Version("0.0.0") · Lightning strategies: 3/4 valid, 0 hits