I thought I understood how import worked...

Ben Finney ben+python at benfinney.id.au
Wed Aug 8 00:14:13 EDT 2012


Cameron Simpson <cs at zip.com.au> writes:

> All of you are saying "two names for the same module", and variations
> thereof. And that is why the doco confuses.
>
> I would expect less confusion if the above example were described as
> _two_ modules, with the same source code.

That's not true though, is it? It's the same module object with two
different references, I thought.

Also, even if what you say were true, “source code” implies the module
was loaded from source code, when Python allows loading modules with no
source code available. So that implication just seems to be inviting
different confusion.

-- 
 \         “I'm not a bad guy! I work hard, and I love my kids. So why |
  `\      should I spend half my Sunday hearing about how I'm going to |
_o__)                                            Hell?” —Homer Simpson |
Ben Finney



More information about the Python-list mailing list