<br><br><div class="gmail_quote">On Thu, Mar 29, 2012 at 4:16 PM, Sasha Hart <span dir="ltr"><<a href="mailto:s@sashahart.net">s@sashahart.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">If the colon can be made safe for Windows it might be desirable, since</div>
it looks fine and reflects existing practice in a number of places.<br></blockquote><div><br></div><div>For *modules*, yes. For scripts, no.</div><div><br></div><div>But for module names, there's no conflict.</div><div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(A) accept only one of the two types of input at all (e.g. insist only<br>
on importable module name - it looks like this is what gunicorn does<br>
and I like it a lot - short of having your code installed on system<br>
PYTHONPATH, or using virtualenv PYTHONPATH, you can also do this if<br>
you are in the directory of the script/package)<br></blockquote><div><br></div><div>This would tend to be my preference, if we don't support both.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(B) use --file=c:\app.py or similar to disambiguate what kind of<br>
parsing to do - then the typical case can be the importable and users<br>
who really want to refer to files explicitly can do so<br></blockquote><div><br></div><div>This is my preference if we do support both - to explicitly separate modules from scripts somehow.</div><div><br></div><div><br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(E) give up colon: first arg is a filepath-or-pythonmodulepath, and<br>
optional second arg is what would have come after the colon. I think<br>
this is your suggestion and it's not unreasonable at all. If we are<br>
talking about 'python -m wsgiref.simple_server c:app app' then the<br>
second positional arg is definitely not the weirdest looking part. I<br>
just question whether it's really necessary - why not either drop the<br>
implicit specification of a filename (A/B) or enforce backslash after<br>
root on windows (C)?</blockquote><div><br></div><div>I don't like accepting both scripts and modules without an explicit marking as to which you're providing. People confuse the two concepts enough already.</div>
<div><br></div></div>