STINNER Victor <vstin...@python.org> added the comment:

I reopen the issue since there is bpo-43228 regression, caused by this issue, 
which is still under discussion, and Mark also proposed to add a new builtins 
parameter to the function constructor (FunctionType).

I wrote PR 24564 to help fixing bpo-43228 regression: with this change, 
functions now inherit the current builtins if the globals namespace is 
overriden, but the new globals has no "__builtins__" key. This change is 
backward incompatible on purpose. If someone really wants to run a function in 
a different builtins namespace, globals['__builtins__'] must be set explicitly.

Once PR 24564 will be merged, I plan to write a 3rd PR to add an optional 
builtins keyword-only parameter to the function constructor (FunctionType).

----------
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42990>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to