Tobiah <[EMAIL PROTECTED]> writes:

> This is a little surprising. So "from mod import *" really copies
> all of the scalars into new variables in the local namespace.

No. Nothing is copied. All the objects (remembering that in Python,
*everything* is an object) created by the code in module 'mod' are
given names in the current namespace.

> I always ASSumed that the two forms of import were equivalent, but
> that one form did away with the need to be explicit about the
> namespace: mod.thing Obviously this is far from the case.

Yes. In fact the main difference is in what namespace the module's
objects are made available.

-- 
 \      "The way to build large Python applications is to componentize |
  `\          and loosely-couple the hell out of everything."  -- Aahz |
_o__)                                                                  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to