Subject: Re: bug#50459: 28.0.50; Python shell completion is incompatible with flex, orderless, etc.

From: Augusto Stoffel <[email-masked]>
Date: Wed, 08 Sep 2021 19:44:48 +0200

On Tue,  7 Sep 2021 at 19:52, Augusto Stoffel <[email-masked]> wrote:

> If I start a Python shell on Emacs -Q and type, say
>
> ```
> x = []
> x.c<tab>
> ```
>
> then I see, as expected,
>
> ```
> Possible completions are:
> x.clear
> x.copy
> x.count
> ```
>
> Now, if I (setq completion-styles '(flex)), then no completions as
> reported in the same situation.  Same thing with the `orderless' or
> `substring' completion styles.
>
> Moreover, the same observation holds for native completion on or off.

On closer inspection (and discussion with the orderless people), the
completion-at-point function in pyhton.el conforms to the completion API.

The issue lies in the fancier completion styles, which always send the
empty string as the STRING argument to any completion table.

There's a workaround for this, which I could provide, but this doesn't
seem advisable.