MCPcopy Index your code
hub / github.com/ipython/ipython / check_complete

Method check_complete

IPython/core/interactiveshell.py:3778–3796  ·  view source on GitHub ↗

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

(self, code: str)

Source from the content-addressed store, hash-verified

3776 runcode = run_code
3777
3778 def check_complete(self, code: str) -> Tuple[str, str]:
3779 """Return whether a block of code is ready to execute, or should be continued
3780
3781 Parameters
3782 ----------
3783 code : string
3784 Python input code, which can be multiline.
3785
3786 Returns
3787 -------
3788 status : str
3789 One of 'complete', 'incomplete', or 'invalid' if source is not a
3790 prefix of valid code.
3791 indent : str
3792 When status is 'incomplete', this is some whitespace to insert on
3793 the next line of the prompt.
3794 """
3795 status, nspaces = self.input_transformer_manager.check_complete(code)
3796 return status, ' ' * (nspaces or 0)
3797
3798 #-------------------------------------------------------------------------
3799 # Things related to GUI support and pylab

Callers 3

promptMethod · 0.45
newline_or_executeFunction · 0.45
newline_autoindentFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected