Skip to content

Commit

Permalink
The type checker knows all
Browse files Browse the repository at this point in the history
  • Loading branch information
kg583 committed Jun 13, 2024
1 parent a10248d commit c10d988
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tivars/types/picture.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class L1(Converter):
@classmethod
def get(cls, data: bytes, **kwargs) -> _T:
"""
Converts ``bytes`` -> ``tuple[int, ...]``
Converts ``bytes`` -> ``tuple[int, int, int, int, int, int, int, int]``
:param data: The raw bytes to convert
:return: A tuple of eight integers in {0, 255} corresponding to the bits of ``data``
Expand All @@ -38,7 +38,7 @@ def get(cls, data: bytes, **kwargs) -> _T:
@classmethod
def set(cls, value: _T, **kwargs) -> bytes:
"""
Converts ``tuple[int, ...]`` -> ``bytes``
Converts ``tuple[int, int, int, int, int, int, int, int]`` -> ``bytes``
:param value: The value to convert
:return: The values in ``value`` joined into a single byte
Expand Down Expand Up @@ -426,7 +426,7 @@ def get_min_os(self, data: bytes = None) -> OsVersion:

@Loader[Sequence]
def load_array(self, arr: Sequence[Sequence[pixel_type]]):
self.data = b''.join(RGB565.set(entry) for row in arr[::-1] for entry in row + [(0, 0, 0)])
self.data = b''.join(RGB565.set(entry) for row in arr[::-1] for entry in [*row, (0, 0, 0)])

def array(self) -> list[list[pixel_type]]:
return [[RGB565.get(self.data[self.data_width * row + col:][:2])
Expand Down

0 comments on commit c10d988

Please sign in to comment.