[Python-ideas] Namespaces and modules [was Deprecate the round builtin]

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Oct 2 01:07:05 CEST 2012


Mark Adam wrote:
> It's not like you can do "import __builtins__" in the interpreter,

But you *can* do "import __builtin__".

Also, "sys" is created at interpreter startup and doesn't correspond
to any disk file, but we don't seem to mind calling it a module and
using the same import syntax to access it.

The only difference I can see with these proposed namespace things is
that they would be pre-bound to names in the builtin namespace.

 > But, it's as if you're
> going on a road trip, you want to travel efficient and light -- what
> you include in your backpack ("interpreter environment") is your
> "builtin" and everything else you'll "buy"/import on the road.
> Modules are those things on the road.

The sys module violates this taxonomy -- it's already in your
backpack, just tucked away in a paper bag that you need to open
first.

-- 
Greg



More information about the Python-ideas mailing list