emacs-devel
[Top][All Lists]
Advanced

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

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


From: Philip Kaludercic
Subject: Re: python-mode: Why python-interpreter defaults to "python" instead of looking for python/python3
Date: Thu, 16 Mar 2023 10:18:02 +0000

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.  

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

>                   
>                   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]