MCPcopy Index your code
hub / github.com/RustPython/RustPython / set_result

Method set_result

Lib/asyncio/futures.py:257–267  ·  view source on GitHub ↗

Mark the future done and set its result. If the future is already done when this method is called, raises InvalidStateError.

(self, result)

Source from the content-addressed store, hash-verified

255 # So-called internal methods (note: no set_running_or_notify_cancel()).
256
257 def set_result(self, result):
258 """Mark the future done and set its result.
259
260 If the future is already done when this method is called, raises
261 InvalidStateError.
262 """
263 if self._state != _PENDING:
264 raise exceptions.InvalidStateError(f'{self._state}: {self!r}')
265 self._result = result
266 self._state = _FINISHED
267 self.__schedule_callbacks()
268
269 def set_exception(self, exception):
270 """Mark the future done and set an exception.

Calls 1

__schedule_callbacksMethod · 0.95