Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions archinstall/lib/models/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,20 +441,20 @@ def _normalize(self) -> int:
return self.value * self.sector_size.normalize()
return int(self.value * self.unit.value)

def __sub__(self, other: Size) -> Size:
def __sub__(self, other: Self) -> Size:
src_norm = self._normalize()
dest_norm = other._normalize()
return Size(abs(src_norm - dest_norm), Unit.B, self.sector_size)

def __add__(self, other: Size) -> Size:
def __add__(self, other: Self) -> Size:
src_norm = self._normalize()
dest_norm = other._normalize()
return Size(abs(src_norm + dest_norm), Unit.B, self.sector_size)

def __lt__(self, other: Size) -> bool:
def __lt__(self, other: Self) -> bool:
return self._normalize() < other._normalize()

def __le__(self, other: Size) -> bool:
def __le__(self, other: Self) -> bool:
return self._normalize() <= other._normalize()

@override
Expand All @@ -471,10 +471,10 @@ def __ne__(self, other: object) -> bool:

return self._normalize() != other._normalize()

def __gt__(self, other: Size) -> bool:
def __gt__(self, other: Self) -> bool:
return self._normalize() > other._normalize()

def __ge__(self, other: Size) -> bool:
def __ge__(self, other: Self) -> bool:
return self._normalize() >= other._normalize()


Expand Down
4 changes: 2 additions & 2 deletions archinstall/lib/models/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __eq__(self, other: object) -> bool:

return self.pkg_version == other.pkg_version

def __lt__(self, other: 'PackageSearchResult') -> bool:
def __lt__(self, other: Self) -> bool:
return self.pkg_version < other.pkg_version


Expand Down Expand Up @@ -105,7 +105,7 @@ def __eq__(self, other: object) -> bool:

return self.version == other.version

def __lt__(self, other: 'LocalPackage') -> bool:
def __lt__(self, other: Self) -> bool:
return self.version < other.version


Expand Down