19 lines
429 B
Python
19 lines
429 B
Python
from dataclasses import dataclass
|
|
|
|
DEFAULT_MAJOR_VERSION = 2
|
|
DEFAULT_MINOR_VERSION = 13
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class Version:
|
|
major: int = DEFAULT_MAJOR_VERSION
|
|
minor: int = DEFAULT_MINOR_VERSION
|
|
|
|
def __str__(self) -> str:
|
|
return f"v{self.major}.{self.minor}"
|
|
|
|
def is_supported(self, other):
|
|
if not isinstance(other, Version):
|
|
return False
|
|
return self.major == other.major
|
|
|