Message169842
| Author |
daniel.wagner-hall |
| Recipients |
daniel.wagner-hall |
| Date |
2012年09月04日.22:59:33 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1346799575.05.0.866449286676.issue15864@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Importing the same module twice should only execute its code once, and should only lead to one copy of the classes defined in the module's file.
If a subdirectory of $PWD is on $PYTHONPATH, and a package is imported both relative to $PWD and relative to that subdirectory, its code is loaded twice, and its classes are defined twice independently.
Downloading the attached file, and running:
mkdir folder
cd folder
tar xf file.tgz
PYTHONPATH=$(pwd)/package python main.py
should print import once, but does print import twice. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年09月04日 22:59:35 | daniel.wagner-hall | set | recipients:
+ daniel.wagner-hall |
| 2012年09月04日 22:59:35 | daniel.wagner-hall | set | messageid: <1346799575.05.0.866449286676.issue15864@psf.upfronthosting.co.za> |
| 2012年09月04日 22:59:34 | daniel.wagner-hall | link | issue15864 messages |
| 2012年09月04日 22:59:33 | daniel.wagner-hall | create |
|