unknowntpo commented on code in PR #6951:
URL: https://github.com/apache/gravitino/pull/6951#discussion_r2045851431
##########
clients/client-python/gravitino/client/gravitino_version.py:
##########
@@ -61,12 +61,13 @@ def __gt__(self, other) -> bool:
raise GravitinoRuntimeException(
f"{GravitinoVersion.__name__} can't compare with
{other.__class__.__name__}"
)
- if self.major > other.major:
- return True
- if self.minor > other.minor:
- return True
- if self.patch > other.patch:
- return True
+ version_cmp = [(self.major, other.major), (self.minor, other.minor),
(self.patch, other.patch)]
+ for (a, b) in version_cmp:
+ if a > b:
+ return True
+ if a < b:
+ return False
+ # self, other is the same
Review Comment:
OMG, this is so ELEGANT! I've changed to this implementation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]