Message90375
| Author |
illume |
| Recipients |
benjamin.peterson, illume, ncoghlan |
| Date |
2009年07月10日.05:21:39 |
| SpamBayes Score |
1.6708857e-14 |
| Marked as misclassified |
No |
| Message-id |
<1247203302.91.0.241771426918.issue2751@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
hello,
thanks for the explanation of why it's that way.
Any ideas of a work around?
python2.5 has been out for ages now. Even if it was an accident, it's
the behavior people expect, and it's still a regression.
Also, why should it matter if a module is a package or a module?
Note how pygame.tests has a type of module, and not of package:
>>> import pygame.tests
>>> type(pygame.tests)
<type 'module'>
Even though it is a package, python calls its type a module. This has
been true for a long time (at least as far back as python2.3).
Because it's a regression, I think this bug should be reopened.
To illustrate why it causes problems, here is part of the documentation
mentioning the __main__.
"""
You can do a self test with:
python -m pygame.tests
Or with python2.6 do:
python -m pygame.tests.__main__
See a list of examples...
python -m pygame.examples
Or with python2.6,
python -m pygame.examples.__main__
"""
It's twice as long, and I doubt anyone will remember the __main__ part.
People used to running their programs with -m now have broken programs
with python2.6.
Having said all that, maybe there is a work around...
One work around might be to make it into a module-module, not a
package-module. Then have the module-module load the package-module
into its namespace. I haven't tested that yet, but it might work. Will
have to go through a round of testing to see how that works out. Will
write back when I've found out the issues with that approach.
cheers, |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2009年07月10日 05:21:43 | illume | set | recipients:
+ illume, ncoghlan, benjamin.peterson |
| 2009年07月10日 05:21:42 | illume | set | messageid: <1247203302.91.0.241771426918.issue2751@psf.upfronthosting.co.za> |
| 2009年07月10日 05:21:41 | illume | link | issue2751 messages |
| 2009年07月10日 05:21:40 | illume | create |
|