[Python-3000] PEP to change how the main module is delineated

Adam Olsen rhamph at gmail.com
Tue Apr 24 00:41:37 CEST 2007

On 4/23/07, Guido van Rossum <guido at python.org> wrote:
> I'm -1 on this and on any other proposed twiddlings of the __main__
> machinery. The only use case seems to be running scripts that happen
> to be living inside a module's directory, which I've always seen as an
> antipattern. To make me change my mind you'd have to convince me that
> it isn't.

So ./python Lib/test/regrtest.py and ./python
Lib/test/test_something.py are both wrong?  I note there's 26 files
marked executable and 50 with #!/usr/bin/env python, so there's quite
a bit of prior art in the "old way".

Besides correcting the stdlib, adding a warning when running a script
from a dir with __init__.py would help change the momentum.

Adam Olsen, aka Rhamphoryncus

More information about the Python-3000 mailing list