From c811080e579b8c2ab1fa44080dfa290a40b1bf90 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sat, 4 Feb 2023 17:04:56 +0900 Subject: [PATCH] Add some docstrings to the ArchPkgVersion class --- update.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/update.py b/update.py index 0b6e3f4..d124edf 100755 --- a/update.py +++ b/update.py @@ -27,6 +27,8 @@ IS_DIGIT_REGEX = re.compile("^[0-9]+$") class ArchPkgVersion: + """Holds a version (typically of an ArchLinux package) for comparison.""" + def __init__(self, version_str): self.versions = [] self.pkgver = 0 @@ -72,6 +74,8 @@ class ArchPkgVersion: self.versions = tuple(self.versions) def compare_with(self, other_self): + """Returns -1 if self is less than other_self, 0 if they are equal, and + 1 if self is greater than other_self.""" self_count = len(self.versions) other_count = len(other_self.versions) if other_count < self_count: