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

Function extract_vars_above

IPython/utils/frame.py:56–67  ·  view source on GitHub ↗

Extract a set of variables by name from another frame. Similar to extractVars(), but with a specified depth of 1, so that names are extracted exactly from above the caller. This is simply a convenience function so that the very common case (for us) of skipping exactly 1 frame doesn

(*names)

Source from the content-addressed store, hash-verified

54
55
56def extract_vars_above(*names):
57 """Extract a set of variables by name from another frame.
58
59 Similar to extractVars(), but with a specified depth of 1, so that names
60 are extracted exactly from above the caller.
61
62 This is simply a convenience function so that the very common case (for us)
63 of skipping exactly 1 frame doesn't have to construct a special dict for
64 keyword passing."""
65
66 callerNS = sys._getframe(2).f_locals
67 return dict((k,callerNS[k]) for k in names)
68
69
70def debugx(expr,pre_msg=''):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected