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

Method then

crates/wasm/Lib/asyncweb.py:86–103  ·  view source on GitHub ↗
(self, success=None, error=None)

Source from the content-addressed store, hash-verified

84 self.__errors = []
85
86 def then(self, success=None, error=None):
87 if success and not callable(success):
88 raise TypeError("success callback must be callable")
89 if error and not callable(error):
90 raise TypeError("error callback must be callable")
91
92 if not self.done:
93 if success:
94 self.__successes.append(success)
95 if error:
96 self.__errors.append(error)
97 return
98
99 cb = success if self.done == 1 else error
100 if cb:
101 return _call_resolve(cb, self.__result)
102 else:
103 return self
104
105 def __await__(self):
106 yield self

Callers 15

main.pyFile · 0.45
genericFetchFunction · 0.45
index.jsFile · 0.45
fetch.pyFile · 0.45
index.jsFile · 0.45
parse_optsFunction · 0.45
_runMethod · 0.45
register_promiseFunction · 0.45
as_strMethod · 0.45
as_asciiMethod · 0.45
as_contiguousMethod · 0.45

Calls 3

callableFunction · 0.85
_call_resolveFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected