MCPcopy
hub / github.com/prompt-toolkit/ptpython / eval_expression

Method eval_expression

src/ptpython/completer.py:435–444  ·  view source on GitHub ↗

Evaluate

(self, document: Document, locals: dict[str, Any])

Source from the content-addressed store, hash-verified

433 raise ReprFailedError
434
435 def eval_expression(self, document: Document, locals: dict[str, Any]) -> object:
436 """
437 Evaluate
438 """
439 match = self.expression_pattern.search(document.text_before_cursor)
440 if match is not None:
441 object_var = match.groups()[0]
442 return self._lookup(object_var, locals)
443
444 return None
445
446 def _get_expression_completions(
447 self,

Callers 2

Calls 1

_lookupMethod · 0.95

Tested by

no test coverage detected