From 5fc595278c4a86f7d741861bc50327c60d714333 Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Thu, 30 May 2024 10:48:45 -0700 Subject: [PATCH] Fix a mypy error with matricizer.py Self type is not allowed to access static members, in this case DIMENSIONS Signed-off-by: Alek Ratzloff --- colorhash/matricizer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/colorhash/matricizer.py b/colorhash/matricizer.py index 6455ff5..6b8f17c 100644 --- a/colorhash/matricizer.py +++ b/colorhash/matricizer.py @@ -1,6 +1,6 @@ "All things that turn a hash into a matrix." import abc -from typing import Mapping, Sequence, Self +from typing import Mapping, Sequence from .palettes import Palette, DEFAULT_PALETTES, GRADIENT_PALETTES, MULTICOLOR_PALETTES @@ -108,7 +108,7 @@ class NibbleMatricizer(Matricizer): @staticmethod def choose_dimensions(hash: str) -> tuple[int, int]: - return Self.DIMENSIONS[hash] + return NibbleMatricizer.DIMENSIONS[hash] def choose_palette( self, data: bytes, palettes: Mapping[str, Palette] | None = None @@ -173,7 +173,7 @@ class RandomartMatricizer(Matricizer): @staticmethod def choose_dimensions(hash: str) -> tuple[int, int]: - return self.DIMENSIONS[hash] + return RandomartMatricizer.DIMENSIONS[hash] def choose_palette( self, data: bytes, palettes: Mapping[str, Palette] | None = None