"import X" and "from X import y" produce different results, Why?

Fredrik Lundh fredrik at pythonware.com
Thu Mar 1 08:01:00 CET 2001

Parzival Herzog wrote:
> So, apparently the imported X is a copy of xx.X, not the same object
> by another name.

it's another *reference* to the same object, not a copy.

I suggest reading up on Python's object semantics:


and maybe also:


Cheers /F

<!-- pythonworks 1.2 coming soon:

More information about the Python-list mailing list