unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Martín Fernández" <tinchofernandez97@gmail.com>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Augusto Stoffel <arstoffel@gmail.com>, emacs-devel@gnu.org
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	[thread overview]
Message-ID: <CAOVCL7WpmRaY5KR_h1CKDEve=Ti7oZF4XjTEJYkkjei0U50PkQ@mail.gmail.com> (raw)
In-Reply-To: <87o7otf19h.fsf@posteo.net>

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
variable?

>
> 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	other threads:[~2023-03-16 14:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 14:03 python-mode: Why python-interpreter defaults to "python" instead of looking for python/python3 Martín Fernández
2023-03-08 19:41 ` Augusto Stoffel
2023-03-16 10:09   ` Augusto Stoffel
2023-03-16 10:18     ` Philip Kaludercic
2023-03-16 14:29       ` Martín Fernández [this message]
2023-03-16 18:13         ` Augusto Stoffel
2023-03-16 18:17       ` Augusto Stoffel
2023-03-16 18:45         ` Yuri Khan
2023-03-17 19:32           ` chad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOVCL7WpmRaY5KR_h1CKDEve=Ti7oZF4XjTEJYkkjei0U50PkQ@mail.gmail.com' \
    --to=tinchofernandez97@gmail.com \
    --cc=arstoffel@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=philipk@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).