Lines Matching defs:globals

250     globals: object(c_default="NULL") = None
261 The globals argument is only used to determine the context;
273 builtin___import___impl(PyObject *module, PyObject *name, PyObject *globals,
277 return PyImport_ImportModuleLevelObject(name, globals, locals,
890 globals: object = None
894 Evaluate the given source in the context of globals and locals.
898 The globals must be a dictionary and locals can be any mapping,
899 defaulting to the current globals and locals.
900 If only globals is given, locals defaults to it.
904 builtin_eval_impl(PyObject *module, PyObject *source, PyObject *globals,
915 if (globals != Py_None && !PyDict_Check(globals)) {
916 PyErr_SetString(PyExc_TypeError, PyMapping_Check(globals) ?
917 "globals must be a real dict; try eval(expr, {}, mapping)"
918 : "globals must be a dict");
921 if (globals == Py_None) {
922 globals = PyEval_GetGlobals();
930 locals = globals;
932 if (globals == NULL || locals == NULL) {
934 "eval must be given globals and locals "
939 int r = PyDict_Contains(globals, &_Py_ID(__builtins__));
941 r = PyDict_SetItem(globals, &_Py_ID(__builtins__), PyEval_GetBuiltins());
957 return PyEval_EvalCode(source, globals, locals);
970 result = PyRun_StringFlags(str, Py_eval_input, globals, locals, &cf);
979 globals: object = None
985 Execute the given source in the context of globals and locals.
989 The globals must be a dictionary and locals can be any mapping,
990 defaulting to the current globals and locals.
991 If only globals is given, locals defaults to it.
997 builtin_exec_impl(PyObject *module, PyObject *source, PyObject *globals,
1003 if (globals == Py_None) {
1004 globals = PyEval_GetGlobals();
1010 if (!globals || !locals) {
1012 "globals and locals cannot be NULL");
1017 locals = globals;
1019 if (!PyDict_Check(globals)) {
1020 PyErr_Format(PyExc_TypeError, "exec() globals must be a dict, not %.100s",
1021 Py_TYPE(globals)->tp_name);
1030 int r = PyDict_Contains(globals, &_Py_ID(__builtins__));
1032 r = PyDict_SetItem(globals, &_Py_ID(__builtins__), PyEval_GetBuiltins());
1077 v = PyEval_EvalCode(source, globals, locals);
1079 v = PyEval_EvalCodeEx(source, globals, locals,
1102 v = PyRun_StringFlags(str, Py_file_input, globals,
1105 v = PyRun_String(str, Py_file_input, globals, locals);
1148 globals as builtin_globals