Skip to main content

Optional

Standard library class
class Optional
@tuple
class Optional[T]
Fields 1
T type
Constructors 2
__new__
__new__()
__new__
@overload
__new__(what: T)
Special methods 15
__to_py__
__to_py__(self: Self, Self: type)
__from_py__
__from_py__(o: cobj)
__has__
__has__(self: Self, Self: type)
__val__
__val__(self: Self, Self: type)
__val_or__
__val_or__(self: Self, default: T, Self: type)
__bool__
__bool__(self: Self, Self: type)
__eq__
__eq__(self: Self, other: T, Self: type)
@overload
__eq__(self: Self, other: Optional[T], Self: type)
__ne__
__ne__(self: Self, other: T, Self: type)
@overload
__ne__(self: Self, other: Optional[T], Self: type)
__str__
__str__(self: Self, Self: type)
__repr__
__repr__(self: Self, Self: type)
__is_optional__
__is_optional__(self: Self, other: Optional[T], Self: type)
__unwrap__
__unwrap__(self: Self, Self: type)
__to_gpu__
__to_gpu__(self: Self, cache: AllocCache, Self: type)
Added by internal.gpu
__from_gpu__
__from_gpu__(self: Self, other: Optional[T], Self: type)
Added by internal.gpu
__from_gpu_new__
__from_gpu_new__(other: Optional[T])
Added by internal.gpu