MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_globals

Method get_globals

Lib/symtable.py:208–215  ·  view source on GitHub ↗

Return a tuple of globals in the function.

(self)

Source from the content-addressed store, hash-verified

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

Callers 1

test_function_infoMethod · 0.80

Calls 2

__idents_matchingMethod · 0.95
_get_scopeFunction · 0.85

Tested by 1

test_function_infoMethod · 0.64