[Python-Dev] PEP397 no command line options to python?

Sam Partington sam.partington at gmail.com
Tue Oct 18 08:20:00 CEST 2011


On 17 October 2011 15:20, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Sam Partington <sam.partington <at> gmail.com> writes:
>
>> That sounds like an explanation of why it hasn't been implemented
>> before, not an explanation of why it should continue that way.
>
> From a desire to keep the launcher as simple as possible, and to minimise the
> need to synchronise the launcher with command line parameter changes in future
> versions of Python.

As simple as possible yes... but no simpler.  I think having
pylauncher behave so differently in the two cases of :

py -u test.py
py test.py

Is very unexpected. And to do so silently, without warning will cause
real headaches_ for users, *especially* since py -h lists -u as one of
the options, it does not say 'here are the python options but you must
call PythonXX/python.exe to use them'.

[headaches : it did for me as I ended up with a broken build of my app
due to different parts of my app built for different pythons.]

To fix this the launcher doesn't need to track all python command line
options, only those that take two args.  I don't really see that it
will be such a maintenance burden to have the launcher track any new
ones.  Python has only two such options after 20 years of development.

As for complexity it's less than 10 lines of C.

>> In any case, I think that expectation is not complete. In my case it
>> was my editor that inserted the '-u' on my behalf.
>>
>> Or why might I not set the default action for .py files to be "py -tt
>> %1", or "py -3 %1".
>>
>> Why deny any of the arguments to a pylauncher user?
>
> Don't forget that customised commands allow Python to be invoked from shebang
> lines with fair flexibility.

That's a cool feature which I'd not really read up on, but that
requires a global configuration file change, it's not doable on a per
usage basis.

> Don't worry about separating them for now, assuming that it's fairly easy to
> figure out which bit is which :-)

It wasn't hard to do and I see you've applied the patch already,
thanks for the fast turn around!

Sam

PS Sorry, I replied off-list again!


More information about the Python-Dev mailing list