use Self type

This commit is contained in:
Jan Petykiewicz 2023-02-23 13:37:34 -08:00 committed by jan
commit 4482ede3a7
17 changed files with 142 additions and 205 deletions

View file

@ -1,4 +1,4 @@
from typing import Callable, TypeVar, TYPE_CHECKING
from typing import Callable, Self, TYPE_CHECKING
from abc import ABCMeta, abstractmethod
import numpy
@ -26,9 +26,6 @@ normalized_shape_tuple = tuple[
DEFAULT_POLY_NUM_VERTICES = 24
T = TypeVar('T', bound='Shape')
class Shape(PositionableImpl, LayerableImpl, Rotatable, Mirrorable, Copyable, Scalable,
PivotableImpl, RepeatableImpl, AnnotatableImpl, metaclass=ABCMeta):
"""
@ -68,7 +65,7 @@ class Shape(PositionableImpl, LayerableImpl, Rotatable, Mirrorable, Copyable, Sc
pass
@abstractmethod
def normalized_form(self: T, norm_value: int) -> normalized_shape_tuple:
def normalized_form(self, norm_value: int) -> normalized_shape_tuple:
"""
Writes the shape in a standardized notation, with offset, scale, and rotation
information separated out from the remaining values.