diff --git a/semantic_version/base.py b/semantic_version/base.py index 871ccb0..cedbe46 100644 --- a/semantic_version/base.py +++ b/semantic_version/base.py @@ -563,14 +563,17 @@ def __hash__(self): return hash((self.kind, self.spec)) +@functools.lru_cache() def compare(v1, v2): return Version(v1).__cmp__(Version(v2)) +@functools.lru_cache() def match(spec, version): return Spec(spec).match(Version(version)) +@functools.lru_cache() def validate(version_string): """Validates a version string againt the SemVer specification.""" try: