Source code for acord.bases.mixins
# TYPEVARS and mixin classes
from typing import TypeVar, Callable, Coroutine
H = TypeVar("H", bound="Hashable") # Hashable object
_C = Callable[..., Coroutine]
T = TypeVar("T")
[docs]class Hashable:
__slots__ = ("__weakref__",)
id: int
def __eq__(self, O) -> bool:
return self.id == getattr(O, "id", O)
def __ne__(self, O) -> bool:
return self.id != getattr(O, "id", O)
def __hash__(self) -> int:
return self.id >> 22