On Sat, Feb 4, 2012 at 6:35 AM, Steven D'Aprano <st...@pearwood.info> wrote:
> Michael Lewis wrote:
>>
>> Why don't I have to import str or list to access their attributes like I
>> do
>> with the math or random or any other library?
>
>
>
> Because they are built-in. That means they live inside the Python
> compiler/interpreter itself.

Blargh, lots of things are built in. The sys module is a built-in
module, but you don't get access to it by default.

It's because they're specially-chosen to be in the "builtin
namespace". This is the namespace of things that are always
accessible. This is different from being built into the interpreter --
hypothetically we could have something in the builtin namespace that
is not part of Python itself. (You can do this by adding things to the
builtin namespace by hand).

-- Devin
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to