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

Method check_complete

IPython/core/interactiveshell.py:3442–3460  ·  view source on GitHub ↗

Return whether a block of code is ready to execute, or should be continued Parameters ---------- source : string Python input code, which can be multiline. Returns ------- status : str One of 'complete', 'incomplete', or 'invalid'

(self, code: str)

Source from the content-addressed store, hash-verified

3440 runcode = run_code
3441
3442 def check_complete(self, code: str) -> Tuple[str, str]:
3443 """Return whether a block of code is ready to execute, or should be continued
3444
3445 Parameters
3446 ----------
3447 source : string
3448 Python input code, which can be multiline.
3449
3450 Returns
3451 -------
3452 status : str
3453 One of 'complete', 'incomplete', or 'invalid' if source is not a
3454 prefix of valid code.
3455 indent : str
3456 When status is 'incomplete', this is some whitespace to insert on
3457 the next line of the prompt.
3458 """
3459 status, nspaces = self.input_transformer_manager.check_complete(code)
3460 return status, ' ' * (nspaces or 0)
3461
3462 #-------------------------------------------------------------------------
3463 # Things related to GUI support and pylab

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected