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

Method from_value

returns/io.py:180–194  ·  view source on GitHub ↗

Unit function to construct new ``IO`` values. Is the same as regular constructor: .. code:: python >>> from returns.io import IO >>> assert IO(1) == IO.from_value(1) Part of the :class:`returns.interfaces.applicative.ApplicativeN` inte

(cls, inner_value: _NewValueType)

Source from the content-addressed store, hash-verified

178
179 @classmethod
180 def from_value(cls, inner_value: _NewValueType) -> 'IO[_NewValueType]':
181 """
182 Unit function to construct new ``IO`` values.
183
184 Is the same as regular constructor:
185
186 .. code:: python
187
188 >>> from returns.io import IO
189 >>> assert IO(1) == IO.from_value(1)
190
191 Part of the :class:`returns.interfaces.applicative.ApplicativeN`
192 interface.
193 """
194 return IO(inner_value)
195
196 @classmethod
197 def from_io(cls, inner_value: 'IO[_NewValueType]') -> 'IO[_NewValueType]':

Callers 2

doMethod · 0.45
_loopMethod · 0.45

Calls 1

IOClass · 0.85

Tested by

no test coverage detected