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

Method get_globals

Lib/symtable.py:209–216  ·  view source on GitHub ↗

Return a tuple of globals in the function.

(self)

Source from the content-addressed store, hash-verified

207 return self.__locals
208
209 def get_globals(self):
210 """Return a tuple of globals in the function.
211 """
212 if self.__globals is None:
213 glob = (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
214 test = lambda x: _get_scope(x) in glob
215 self.__globals = self.__idents_matching(test)
216 return self.__globals
217
218 def get_nonlocals(self):
219 """Return a tuple of nonlocals in the function.

Callers 2

test_function_infoMethod · 0.80

Calls 2

__idents_matchingMethod · 0.95
_get_scopeFunction · 0.85

Tested by 2

test_function_infoMethod · 0.64