Skip to content

module internal.types.optional

Source: stdlib/internal/types/optional.codon


Optional[T] @extend Class is extended to add given methods

Magic methods

__new__()

__new__(what: T) @overload Function is overloaded

__has__(self)

__val__(self)

__val_or__(self, default: T)

__bool__(self)

__eq__(self, other: T)

__eq__(self, other: Optional[T]) @overload Function is overloaded

__ne__(self, other: T)

__ne__(self, other: Optional[T]) @overload Function is overloaded

__str__(self)

__repr__(self)

__is_optional__(self, other: Optional[T])


optional = Optional


unwrap(opt: Optional[T], T: type)