This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author roysmith
Recipients docs@python, roysmith
Date 2012-08-07.18:11:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344363062.87.0.467457264308.issue15575@psf.upfronthosting.co.za>
In-reply-to
Content
Opening this bug at Ben Finney's request.  See https://groups.google.com/forum/?fromgroups#!topic/comp.lang.python/wmDUrpW2ZCU for the full thread discussing the problem.  Here's a significant excerpt:

-------------------------------------------------
The tutorial is misleading on this. It it says plainly: 

    A module can contain executable statements as well as function 
    definitions. […] They are executed only the *first* time the module 
    is imported somewhere. 

    <URL:http://docs.python.org/tutorial/modules.html> 

but it doesn't make clear that a module can exist in the ‘sys.modules’ 
list multiple times under different names. 
-------------------------------------------------


Also note:

--------------------------------------------------
The footnote to that is wrong too: 

> [1]        In fact function definitions are also ‘statements’ that are ‘executed’; the execution of a module-level function enters the function name in the module’s global symbol table. 

I think what it's supposed to say is "... the execution of a module-level def statement ..." 
---------------------------------------------------
History
Date User Action Args
2012-08-07 18:11:03roysmithsetrecipients: + roysmith, docs@python
2012-08-07 18:11:02roysmithsetmessageid: <1344363062.87.0.467457264308.issue15575@psf.upfronthosting.co.za>
2012-08-07 18:11:01roysmithlinkissue15575 messages
2012-08-07 18:11:00roysmithcreate