Martijn Faassen: The Call of Python 2.8
Steven D'Aprano
steve at pearwood.info
Wed Apr 16 04:13:42 EDT 2014
On Wed, 16 Apr 2014 02:32:00 -0500, Andrew Berg wrote:
> On 2014.04.15 20:21, Steven D'Aprano wrote:
>> On Tue, 15 Apr 2014 17:32:57 -0500, Andrew Berg wrote:
>>
>>> On 2014.04.15 17:18, Ned Batchelder wrote:
>>>> Yeah, that's the wrong way to do it, and they shouldn't have done
>>>> that.
>>>> "python" needs to mean Python 2.x for a long time.
>>> Or maybe explicit is better than implicit:
>>>
>>> # python
>>> zsh: command not found: python
>>> # which python2.7
>>> /usr/local/bin/python2.7
>>> # which python3.4
>>> /usr/local/bin/python3.4
>>
>> If you really meant that, you would have typed "/usr/bin/which2.16
>> python" (or whatever the location and version of which on your system).
> Are you sure about that?
> # which which
> which: shell built-in command
> Unless I'm forgetting some more explicit way of calling a command built
> into the shell.
I've tried it on two different systems:
steve at runes:~$ which which
/usr/bin/which
although I see you are running as root:
steve at runes:~$ su -
Password:
root at runes:~# which which
/usr/bin/which
Nope, that makes no difference. In any case, you're missing my point,
which is not *where* the which binary lives, but the fact that you're
calling some specific version, located in some specific place (even if
that place is a virtual place inside the shell) implicitly rather than
explicitly. Which is usually (but not always!) what we want for an
interactive shell. Who wants to be typing out explicit paths to versioned
binaries *all the time*?
--
Steven
More information about the Python-list
mailing list