Ezio Melotti <ezio.melo...@gmail.com> added the comment:

> A separate issue would be a feature request to not do that (assuming it 
> really does).

I tried to verify this (the fact that modules get imported with 
help('modules')).  Here are the results:
  * Lib/foobar.py:
    - help('modules'): foobar in the list, code is *not* executed;
    - help('foobar'): code is executed;
  * Lib/deleteme/__init__.py:
    - help('modules'): deleteme in the list, code is executed;
    - help('deleteme'): code is executed;
  * Lib/deleteme/__init__.py and Lib/deleteme/foobar.py:
    - help('modules'): deleteme in the list, only __init__ code is executed;
    - help('deleteme.foobar'): foobar code is executed;

So it seems the only code that gets executed with help('modules') is the one in 
packages' __init__s.  It also seems that the code is executed only once, so 
doing help('deleteme') after help('modules') doesn't execute the code again.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to