# Situation If you pass negative numbers into `semver.VersionInfo` it doesn't raise any errors: ```python >>> import semver >>> semver.VersionInfo(-2) VersionInfo(major=-2, minor=0, patch=0, prerelease=None, build=None) ``` Tested with latest 2.11.0 # Proposal I guess, this shouldn't happen. We should raise a ValueError exception. Would integrate that into a 2.12.0 release and into the upcoming 3.0.0-alpha0. @tlaferriere Thomas, can you conform? Do you agree?
Activity
Fix python-semver#291: Disallow negative numbers in VersionInfo
Fix python-semver#291: Disallow negative numbers in VersionInfo
Fix python-semver#291: Disallow negative numbers in VersionInfo
tlaferriere commentedon Oct 19, 2020
I agree. It is doesn't make sense to have negative version numbers, whichever way you put it.
s-celles commentedon Oct 19, 2020
Hi all,
according to https://semver.org/
So according spec, negative integers are not allowed.
tomschr commentedon Oct 19, 2020
Thanks to both of you for confirming. It's surprising that this bug could survive that long. 😄
Fix #291: Disallow negative numbers in VersionInfo (#292)
Prepare 2.12.0 release (python-semver#293)
Prepare 2.12.0 release (#293) (#294)