rainbowadn/rainbowadn/data/collection/keyed.py

16 lines
400 B
Python

import abc
from typing import Generic, TypeVar
from rainbowadn.core.hashpoint import HashPoint
from rainbowadn.core.recursivementionable import RecursiveMentionable
__all__ = ('Keyed',)
KKeyType = TypeVar('KKeyType')
class Keyed(RecursiveMentionable, Generic[KKeyType], abc.ABC):
def __init__(self, key: HashPoint[KKeyType]):
assert isinstance(key, HashPoint)
self.key = key