Message144432
| Author |
ezio.melotti |
| Recipients |
docs@python, dronus, eric.araujo, ezio.melotti, rhettinger, terry.reedy |
| Date |
2011年09月22日.23:40:13 |
| SpamBayes Score |
0.00018407778 |
| Marked as misclassified |
No |
| Message-id |
<1316734814.9.0.254846330826.issue12902@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> 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. |
|