GNU bug report logs -
#76205
31.0.50; 31.0.50; python.el completion broken for non-builtin objects in IPython 8.30.0 & Python 3.13.2
Previous Next
Reported by: Visuwesh <visuweshm <at> gmail.com>
Date: Tue, 11 Feb 2025 15:08:01 UTC
Severity: normal
Found in version 31.0.50
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 76205 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Visuwesh wrote:
> >> > The problem seems to be not related to emacs, because the completion
> >> > of non-builtin objects doesn't work in terminal too (IPython 8.32.0
> >> > and Python 3.13.2):
> >> >
> >> > 1. run ipython in a terminal: ipython3 --simple-prompt -i
> >> >
> >> > 2. type the following code:
> >> > import readline
> >> > import rlcompleter
> >> > readline.parse_and_bind("tab: complete")
> >> > import numpy as np
> >> >
> >> > 3. type np.<TAB>, there is no completion
> >> >
> >> >
> >> > If I change the completer to others (e.g. jedi):
> >> > from jedi.utils import setup_readline
> >> > setup_readline()
> >> >
> >> > then the completion works in both terminal and emacs.
> >
> > Thanks for pointing this out. So I confirmed that the following
> > workaround is also effective.
> >
> > PYTHONSTARTUP="$(python -m jedi repl)" emacs -nw -Q
>
> So...what do we do from here? Unfortunately, I know next to nothing
> about this area to file a sensible bug report myself.
I'm not sure either. As ipython --simple-prompt does not support
completion, I don't know if using rlcompleter with ipython
--simple-prompt is supported or not.
The direct cause of this problem seems to be that rlcompleter.__main__
is not as expected. So the following steps enable completion on
ipython --simple-prompt on Python 3.13.
import readline
import rlcompleter
import __main__
rlcompleter.__main__ = __main__
readline.parse_and_bind("tab: complete")
Attached is a test patch that does something similar to this.
[workaround.patch (application/octet-stream, attachment)]
This bug report was last modified 89 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.