[Python-Dev] PEP397 no command line options to python? (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Mon Oct 24 02:46:20 CEST 2011


On Mon, Oct 24, 2011 at 10:00 AM, Mark Hammond <skippy.hammond at gmail.com> wrote:

* The "magic" symbol is somewhat self-documenting - it implies a question.  Using  --which adds another special case that people would need to understand isn't passed to Python.  IOW, I like that there is only 1 special option and that one special option can be expressed in the form of a question.

This may be a difference in what we're used to. To me, the "-?" is strongly associated with "-h" and "--help", whereas "--which" maps directly to the *nix "which" command:

$ which python /usr/bin/python

As far as simplicity and extensibility go, I would treat "--which" the way most programs treat "--help" and "--version" - they can appear anywhere on the command line and completely change the expected output of the command:

$ python -Ei --version -c "This is never evaluated" Python 2.7.1

So I don't actually see any particularly new design decisions to be made in relation to a "--which" option - it's just a workaround for the lack of a native 'which' equivalent on Windows, and it behaves like Python's own "--version" option.

Cheers, Nick.

-- Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-Dev mailing list