On Fri, Dec 13, 2019, at 19:24, Steven D'Aprano wrote: > `__builtins__` is a private CPython implementation detail, so the above > is always wrong in user code. Better:
Wait, it is? Is there then no portable way to do the things like: - providing an alternate __builtins__ to evaluated code, with some changed or removed - providing an alternate __builtins__ for the current module, to override things like __import__, __build_class__, etc [that cannot be simply replaced with globals] to change the behavior of import/class statements without having an effect on other modules? (This is very far from the topic of first(), and maybe belongs on python-list, but I was surprised to hear that... I don't want to start a long digression here though.) _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RTFVZRADUI72YFBCQOP464K4LNLB3UBJ/ Code of Conduct: http://python.org/psf/codeofconduct/