stdlibx.option.methods.base module

stdlibx.option.methods.base.and_(opt, other)[source]
Parameters:
  • opt (Option[T])

  • other (Option[U])

Return type:

Option[U]

stdlibx.option.methods.base.and_then(opt, func)[source]
Parameters:
  • opt (Option[T])

  • func (Callable[[T], Option[U]])

Return type:

Option[U]

stdlibx.option.methods.base.expect(opt, msg)[source]
Parameters:
  • opt (Option[T])

  • msg (str)

Return type:

T

stdlibx.option.methods.base.filter_(opt, predicate)[source]
Parameters:
  • opt (Option[T])

  • predicate (Callable[[T], bool])

Return type:

Option[T]

stdlibx.option.methods.base.flatten(opt)[source]
Parameters:

opt (Option[Option[T]])

Return type:

Option[T]

stdlibx.option.methods.base.inspect(opt, func)[source]
Parameters:
  • opt (Option[T])

  • func (Callable[[T], None])

Return type:

Option[T]

stdlibx.option.methods.base.is_none_or(opt, func)[source]
Parameters:
  • opt (Option[T])

  • func (Callable[[T], bool])

Return type:

bool

stdlibx.option.methods.base.is_some_and(opt, func)[source]
Parameters:
  • opt (Option[T])

  • func (Callable[[T], bool])

Return type:

bool

stdlibx.option.methods.base.map_(opt, func)[source]
Parameters:
  • opt (Option[T])

  • func (Callable[[T], U])

Return type:

Option[U]

stdlibx.option.methods.base.map_or(opt, default, func)[source]
Parameters:
  • opt (Option[T])

  • default (U)

  • func (Callable[[T], U])

Return type:

U

stdlibx.option.methods.base.map_or_else(opt, default, func)[source]
Parameters:
  • opt (Option[T])

  • default (Callable[[], U])

  • func (Callable[[T], U])

Return type:

U

stdlibx.option.methods.base.or_(opt, default)[source]
Parameters:
  • opt (Option[T])

  • default (Option[T])

Return type:

Option[T]

stdlibx.option.methods.base.or_else(opt, default)[source]
Parameters:
  • opt (Option[T])

  • default (Callable[[], Option[T]])

Return type:

Option[T]

stdlibx.option.methods.base.unwrap(opt)[source]
Parameters:

opt (Option[T])

Return type:

T

stdlibx.option.methods.base.unwrap_or(opt, default)[source]
Parameters:
  • opt (Option[T])

  • default (T)

Return type:

T

stdlibx.option.methods.base.unwrap_or_else(opt, func)[source]
Parameters:
  • opt (Option[T])

  • func (Callable[[], T])

Return type:

T

stdlibx.option.methods.base.xor(opt, other)[source]
Parameters:
  • opt (Option[T])

  • other (Option[T])

Return type:

Option[T]

stdlibx.option.methods.base.zipped(opt, func)[source]
Parameters:
  • opt (Option[tuple[Unpack[Ts]]])

  • func (Callable[[Unpack[Ts]], Option[U]])

Return type:

Option[tuple[Unpack[Ts], U]]