[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: python-mode: Why python-interpreter defaults to "python" instead of

From: Martín Fernández
Subject: Re: python-mode: Why python-interpreter defaults to "python" instead of looking for python/python3
Date: Thu, 16 Mar 2023 11:29:28 -0300

On 3/16/23, Philip Kaludercic <philipk@posteo.net> wrote:
> Augusto Stoffel <arstoffel@gmail.com> writes:
>> Hi again Martín,
>> On Wed,  8 Mar 2023 at 20:41, Augusto Stoffel wrote:
>>> On Wed,  8 Mar 2023 at 11:03, Martín Fernández wrote:
>>>> Hey,
>>>> I'm wondering why there is no logic to find the latest python
>>>> executable installed (python vs python3) when setting
>>>> `python-interpreter`, as it is done with `python-shell-interpreter`.
>>>> I think it should be added, but since it is a straightforward change I
>>>> assume there are reasons for it. Otherwise I'm happy to send a patch.
>> Can you expand a bit on why you think so?  I just noticed that Debian
>> doesn't provide a `python' command by default, so indeed some logic
>> might be needed.

I think because it's already done for the interpreter variable, why is
that different? And yes, I'm a debian user, and `python` runs python2.
So yes, it's consistency and convince (for me).

But to be honest, the more I think about it, the more I think that it
should be set on a per project basis. But again, then I would remove
the logic on the interpreter variable and just default to "python", as
you mentioned.

What do you think? Do you know what the history is for the logic on
the interpreter variable and why it wasn't implemented on the cmdline

> That depends on your version.  According to [0], Debian 11 has a package
> called "python2-is-python" that just create a symlink between python and
> python2.  This has been removed with Debian 12, now you'd have to
> install python-is-python3 to have python symlink'ed to python3.
> [0] https://wiki.debian.org/Python/FAQ#Python_2_support

Oh I didn't know that! Thank you!

>>                   But then it should look for python, then python3, and
>> finally fall back to python.  Still, doing so has its downsides, as I
>> mentioned in my previous message.
>>> IMO the logic to choose `python-shell-interpreter' is misguided.  The
>>> default value should be just "python", since if you are doing anything
>>> with Python and "python" doesn't point to the right version, then you
>>> are in trouble anyway.  OTOH, if you really need to work with Python 2
>>> and symlink "python" accordingly then the current default proactively
>>> puts you in trouble.
>>> Personally I'd be happy to see a patch fixing
>>> `python-shell-interpreter'.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]