From 94b478badf70b01ef02411b435278f9cf86e010e Mon Sep 17 00:00:00 2001 From: Ben Finney Date: Wed, 19 Oct 2016 00:00:21 +1100 Subject: [PATCH] Rename version parts binding for clarity. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The “version info” meaning already conventionally means the tuple of version components, like ‘sys.version_info’. Rename the mapping to avoid this meaning. --- semver.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/semver.py b/semver.py index ead1628..7baf57a 100644 --- a/semver.py +++ b/semver.py @@ -28,13 +28,13 @@ def parse(version): if match is None: raise ValueError('%s is not valid SemVer string' % version) - verinfo = match.groupdict() + version_parts = match.groupdict() - verinfo['major'] = int(verinfo['major']) - verinfo['minor'] = int(verinfo['minor']) - verinfo['patch'] = int(verinfo['patch']) + version_parts['major'] = int(version_parts['major']) + version_parts['minor'] = int(version_parts['minor']) + version_parts['patch'] = int(version_parts['patch']) - return verinfo + return version_parts def compare(ver1, ver2):