[Python-Dev] PEP397 no command line options to python?
Nick Coghlan
ncoghlan at gmail.com
Mon Oct 24 03:32:09 CEST 2011
On Mon, Oct 24, 2011 at 11:15 AM, Mark Hammond
<mhammond at skippinet.com.au> wrote:
>> 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,
>
> Actually I don't think that is true - even with a 'which' on Windows you
> can't get this information from it. Indeed, this functionality is quite
> distinct from that offered by which.
True, that comparison was a bad one - the launcher takes into account
more than just path entries the way the *nix equivalent does. Still,
it's a tool in the same spirit, even if the mechanics differs.
> TBH I'm not that bothered - I just have a slight uneasiness to this new
> special option which really just helps describe what a different special
> option does.
>
> So - in an effort to talk myself out of my idea... :) one advantage --which
> would have is that it could work without any version qualifiers at all - eg:
>
> % py --which path/to/script.py
>
> could also tell you what version of Python would be used to execute the
> named script, taking into account the current defaults, environment
> variables and shebang line found in the script.
I was actually just thinking of the simple "py --which" use case, but
you're right, it could be extended to shebang line checking as well.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list