Message127413
| Author |
pitrou |
| Recipients |
asksol, brett.cannon, brian.curtin, georg.brandl, jnoller, michael.foord, ncoghlan, pitrou, terry.reedy, vstinner |
| Date |
2011年01月29日.13:14:50 |
| SpamBayes Score |
4.862466e-11 |
| Marked as misclassified |
No |
| Message-id |
<1296306891.07.0.543642257285.issue10845@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Nick, a more problematic issue is that __main__ is always called __main__, regardless of whether it is actually imported as the real "main module" or through a regular import. This means that it is impossible to discriminate between both uses by using "if __name__ == '__main__'", which in turn means that top-level code will always get executed as a side-effect of importing, which means the "__main__.py" feature is completely broken for use with multiprocessing under Windows!
This also shows, IMO, how uselessly complicated and misleading the import system has become. |
|