rainbowadn/rainbowadn/collection/keyed.py
2023-10-02 19:07:57 +00:00

15 lines
347 B
Python

import abc
from typing import Generic, TypeVar
from rainbowadn.core import *
__all__ = ("Keyed",)
KKeyType = TypeVar("KKeyType", bound=Mentionable, covariant=True)
class Keyed(RecursiveMentionable, Generic[KKeyType], abc.ABC):
def __init__(self, key: HashPoint[KKeyType]):
assert isinstance(key, HashPoint)
self.key = key