MCPcopy Index your code
hub / github.com/dry-python/returns / apply

Method apply

returns/maybe.py:423–427  ·  view source on GitHub ↗

Calls a wrapped function in a container on this container.

(self, container)

Source from the content-addressed store, hash-verified

421 return Some(function(self._inner_value))
422
423 def apply(self, container):
424 """Calls a wrapped function in a container on this container."""
425 if isinstance(container, Some):
426 return self.map(container.unwrap()) # type: ignore
427 return container
428
429 def lash(self, function):
430 """Does nothing for ``Some``."""

Callers

nothing calls this directly

Calls 2

mapMethod · 0.95
unwrapMethod · 0.45

Tested by

no test coverage detected