19 lines
460 B
Python
19 lines
460 B
Python
from typing import Generic, TypeVar
|
|
|
|
from rainbowadn.hashing.nullability.nullable import Nullable
|
|
|
|
__all__ = ('NotNull',)
|
|
|
|
NullableType = TypeVar('NullableType')
|
|
|
|
|
|
class NotNull(Nullable[NullableType], Generic[NullableType]):
|
|
def __init__(self, value: NullableType):
|
|
self.value = value
|
|
|
|
def __eq__(self, other):
|
|
if isinstance(other, NotNull):
|
|
return self.value == other.value
|
|
else:
|
|
return NotImplemented
|