MCPcopy Index your code
hub / github.com/python/cpython / get_entity

Function get_entity

Lib/idlelib/calltip.py:133–144  ·  view source on GitHub ↗

Return the object corresponding to expression evaluated in a namespace spanning sys.modules and __main.dict__.

(expression)

Source from the content-addressed store, hash-verified

131
132
133def get_entity(expression):
134 """Return the object corresponding to expression evaluated
135 in a namespace spanning sys.modules and __main.dict__.
136 """
137 if expression:
138 namespace = {**sys.modules, **__main__.__dict__}
139 try:
140 return eval(expression, namespace) # Only protect user code.
141 except BaseException:
142 # An uncaught exception closes idle, and eval can raise any
143 # exception, especially if user classes are involved.
144 return None
145
146# The following are used in get_argspec and some in tests
147_MAX_COLS = 85

Callers 1

fetch_tipMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…