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

Method throw

Lib/_collections_abc.py:370–380  ·  view source on GitHub ↗

Raise an exception in the generator. Return next yielded value or raise StopIteration.

(self, typ, val=None, tb=None)

Source from the content-addressed store, hash-verified

368
369 @abstractmethod
370 def throw(self, typ, val=None, tb=None):
371 """Raise an exception in the generator.
372 Return next yielded value or raise StopIteration.
373 """
374 if val is None:
375 if tb is None:
376 raise typ
377 val = typ()
378 if tb is not None:
379 val = val.with_traceback(tb)
380 raise val
381
382 def close(self):
383 """Raise GeneratorExit inside generator.

Callers 1

closeMethod · 0.95

Calls 1

with_tracebackMethod · 0.80

Tested by

no test coverage detected