-
Notifications
You must be signed in to change notification settings - Fork 97
Labels
BugError, flaw or fault to produce incorrect or unexpected resultsError, flaw or fault to produce incorrect or unexpected resultsDocDocumentation related issueDocumentation related issue
Description
VersionInfo.next_version()
return type is uncertain because at line 463 of semver.py return version.replace(prerelease=None, build=None)
returns a VersionInfo object, whereas in line 466 it is explicitly converted to str
and at line 470, version.bump_prerelease()
is documented with rtype: str
.
This is problematic because if you call this on a version that has a prerelease or build number, you get a VersionInfo
object, and otherwise you get a str
, and these two types must be handled quite differently.
Personally, I would expect VersionInfo.next_version()
to return a VersionInfo
object in all cases, but I think the main problem here is the ambiguity of the return type.
Metadata
Metadata
Assignees
Labels
BugError, flaw or fault to produce incorrect or unexpected resultsError, flaw or fault to produce incorrect or unexpected resultsDocDocumentation related issueDocumentation related issue