[Python-Dev] [poll] New name for builtins (original) (raw)

Jason Orendorff jason.orendorff at gmail.com
Fri Nov 30 01:05:26 CET 2007


On Nov 29, 2007 11:54 AM, Guido van Rossum <guido at python.org> wrote:

But then I thought, what if we renamed the builtin module instead to builtins, and left builtins alone?

Hmm. builtins is a magic hook, but builtin-the-module isn't the thing it hooks, exactly, not the way import hooks import or iter hooks iter(). Really the builtin module implements the builtins hook protocol. It would be cool to have a name for builtin the module that suggests that.

I suggest sys.builtins. The builtins module feels both central enough and magical enough to belong in sys. And a lot of other stuff in sys has the same "it's fun but slightly crazy to tweak this knob" vibe. And, for sandboxers, mysandbox.builtins seems like a nice parallel to sys.builtins, with "sys" serving the bonus role of suggesting "unrestricted access".

-j



More information about the Python-Dev mailing list