MCPcopy Create free account
hub / github.com/numpy/numpy / _compare_version

Method _compare_version

numpy/lib/_version.py:78–97  ·  view source on GitHub ↗

Compare major.minor.bugfix

(self, other)

Source from the content-addressed store, hash-verified

76 self.is_devversion = bool(re.search(r'.dev', vstring))
77
78 def _compare_version(self, other):
79 """Compare major.minor.bugfix"""
80 if self.major == other.major:
81 if self.minor == other.minor:
82 if self.bugfix == other.bugfix:
83 vercmp = 0
84 elif self.bugfix > other.bugfix:
85 vercmp = 1
86 else:
87 vercmp = -1
88 elif self.minor > other.minor:
89 vercmp = 1
90 else:
91 vercmp = -1
92 elif self.major > other.major:
93 vercmp = 1
94 else:
95 vercmp = -1
96
97 return vercmp
98
99 def _compare_pre_release(self, other):
100 """Compare alpha/beta/rc/final."""

Callers 1

_compareMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected