Baffled by readline module

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Thu Mar 9 22:00:41 EST 2023


On 2023-03-10 at 12:57:48 +1100,
Chris Angelico <rosuav at gmail.com> wrote:

> On Fri, 10 Mar 2023 at 12:56, Greg Ewing via Python-list
> <python-list at python.org> wrote:
> >
> > On 10/03/23 1:46 pm, Grant Edwards wrote:
> > > That's not how it acts for me. I have to "import readline" to get
> > > command line recall and editing.
> >
> > Maybe this has changed? Or is platform dependent?
> >
> > With Python 3.8 on MacOSX I can use up arrow with input()
> > to recall stuff I've typed before, without having to
> > import anything.
> >
> 
> import sys; "readline" in sys.modules
> 
> Is it? Might be that something's pre-importing it.

My ~/.pythonrc contains the following:

    import readline
    import rlcompleter
    readline.parse_and_bind( 'tab: complete' )

IIRC, that's been there "forever," certainly back into Python2, and
probably back into Python1.  On my Arch Linux system Python 3.10.9, I
get readline behavior with or without those lines.


More information about the Python-list mailing list