cpython/Include/internal
Victor Stinner 46496f9d12
bpo-42990: Functions inherit current builtins (GH-24564)
The types.FunctionType constructor now inherits the current builtins
if the globals dictionary has no "__builtins__" key, rather than
using {"None": None} as builtins: same behavior as eval() and exec()
functions.

Defining a function with "def function(...): ..." in Python is not
affected, globals cannot be overriden with this syntax: it also
inherits the current builtins.

PyFrame_New(), PyEval_EvalCode(), PyEval_EvalCodeEx(),
PyFunction_New() and PyFunction_NewWithQualName() now inherits the
current builtins namespace if the globals dictionary has no
"__builtins__" key.

* Add _PyEval_GetBuiltins() function.
* _PyEval_BuiltinsFromGlobals() now uses _PyEval_GetBuiltins() if
  builtins cannot be found in globals.
* Add tstate parameter to _PyEval_BuiltinsFromGlobals().
2021-02-20 15:17:18 +01:00
..
pycore_abstract.h
pycore_accu.h
pycore_ast.h bpo-41796: Make _ast module state per interpreter (GH-23024) 2020-11-02 22:03:28 +01:00
pycore_atomic.h
pycore_atomic_funcs.h
pycore_bitutils.h
pycore_bytes_methods.h
pycore_call.h
pycore_ceval.h
pycore_code.h
pycore_condvar.h
pycore_context.h
pycore_dtoa.h
pycore_fileutils.h
pycore_format.h
pycore_gc.h
pycore_getopt.h
pycore_gil.h
pycore_hamt.h
pycore_hashtable.h
pycore_import.h
pycore_initconfig.h
pycore_interp.h
pycore_list.h
pycore_long.h
pycore_object.h
pycore_pathconfig.h
pycore_pyerrors.h
pycore_pyhash.h
pycore_pylifecycle.h
pycore_pymem.h
pycore_pystate.h
pycore_runtime.h
pycore_sysmodule.h
pycore_traceback.h
pycore_tuple.h
pycore_ucnhash.h
pycore_unionobject.h
pycore_warnings.h