remove plain_data Generic workaround
authorJacob Lifshay <programmerjake@gmail.com>
Thu, 13 Oct 2022 01:36:33 +0000 (18:36 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Thu, 13 Oct 2022 01:36:33 +0000 (18:36 -0700)
src/bigint_presentation_code/toom_cook.py

index 02ddb4b0af6d524beaecf798886601eb1c74d6d0..50eb8043d1abbdaca7478c51c4c09cc14217a0f5 100644 (file)
@@ -10,22 +10,16 @@ from collections import defaultdict
 from enum import Enum, unique
 from functools import lru_cache
 from typing import (Sequence, AbstractSet, Iterable, Mapping,
-                    TYPE_CHECKING, Sequence, TypeVar)
+                    TYPE_CHECKING, Sequence, TypeVar, Generic)
 
 from nmutil.plain_data import plain_data
 
 if TYPE_CHECKING:
     from typing_extensions import final, Self
-    from typing import Generic
 else:
     def final(v):
         return v
 
-    # make plain_data work with Generics
-    class Generic:
-        def __class_getitem__(cls, item):
-            return object
-
 
 @plain_data(frozen=True, unsafe_hash=True)
 class PhysLoc(metaclass=ABCMeta):