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

Mark Adam dreamingforward at gmail.com
Mon Oct 1 18:12:46 CEST 2012


On Mon, Oct 1, 2012 at 1:05 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> I'm not sure why "built-in module" is a better term for something which
> I gather is a separate namespace within a module, so you can have:

Yeah, I'm not really sure it makes sense to call it a module at all.
I was sort of capitulating about the use of the word "module".   It's
not like you can do "import __builtins__" in the interpreter, so if
one is going to call it a module (like the interpreter currently
does), one should see that it is a very special exception of the word.

I prefer "namespace", it's the built-in namespace which is a synonym
for "the global module".

>> Well, to me there must be a clear partitioning.
>>
>> The stuff in the builtin [module] sets the tone for the whole
>> interpreter environment (and I think python culture itself).  If one
>> were to use the standard import language (like in your example), it
>> confuses one "semantically" -- because you're suggesting to treat a it
>> (i.e. a whole class of "things") as something optional.
>>
>> Does that make sense?
>
> Not to me, I'm afraid.

Hopefully the above makes it a little clearer.  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.

mark



More information about the Python-ideas mailing list