From c10d9889cb6423dca908aa1057eee27328be5029 Mon Sep 17 00:00:00 2001 From: KG Date: Thu, 13 Jun 2024 00:10:25 -0500 Subject: [PATCH] The type checker knows all --- tivars/types/picture.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tivars/types/picture.py b/tivars/types/picture.py index a400d5e..b432c04 100644 --- a/tivars/types/picture.py +++ b/tivars/types/picture.py @@ -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`` @@ -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 @@ -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])