MCPcopy Create free account
hub / github.com/ipython/ipython / ExecutionResult

Class ExecutionResult

IPython/core/interactiveshell.py:308–336  ·  view source on GitHub ↗

The result of a call to :meth:`InteractiveShell.run_cell` Stores information about what took place.

Source from the content-addressed store, hash-verified

306
307
308class ExecutionResult(object):
309 """The result of a call to :meth:`InteractiveShell.run_cell`
310
311 Stores information about what took place.
312 """
313 execution_count = None
314 error_before_exec = None
315 error_in_exec = None
316 info = None
317 result = None
318
319 def __init__(self, info):
320 self.info = info
321
322 @property
323 def success(self):
324 return (self.error_before_exec is None) and (self.error_in_exec is None)
325
326 def raise_error(self):
327 """Reraises error if `success` is `False`, otherwise does nothing"""
328 if self.error_before_exec is not None:
329 raise self.error_before_exec
330 if self.error_in_exec is not None:
331 raise self.error_in_exec
332
333 def __repr__(self):
334 name = self.__class__.__qualname__
335 return '<%s object at %x, execution_count=%s error_before_exec=%s error_in_exec=%s info=%s result=%s>' %\
336 (name, id(self), self.execution_count, self.error_before_exec, self.error_in_exec, repr(self.info), repr(self.result))
337
338
339class InteractiveShell(SingletonConfigurable):

Callers 2

_run_cellMethod · 0.85
run_cell_asyncMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected