-
-
Notifications
You must be signed in to change notification settings - Fork 137
Closed
Description
Currently it is impossible to use this monad due to this bug in typing
:
x: Optional[int]
Monad.new(x) # ?
Type will be: Some[Union[int, None]]
, not Union[Some[int], Nothing]
Related:
Lines 10 to 24 in edb8ae2
_ContainerType = TypeVar('_ContainerType', bound=Container) | |
_ValueType = TypeVar('_ValueType') | |
_NewValueType = TypeVar('_NewValueType') | |
class Maybe(GenericContainerOneSlot[_ValueType], metaclass=ABCMeta): | |
@overload | |
@classmethod | |
def new(cls, inner_value: Literal[None]) -> 'Nothing': # type: ignore | |
... | |
@overload # noqa: F811 | |
@classmethod | |
def new(cls, inner_value: _ValueType) -> 'Some[_ValueType]': | |
... |
Metadata
Metadata
Assignees
Labels
No labels