Tab-completion in tutorial

S

Steven D'Aprano

I'm reading the part of the tutorial that talks about tab-completion, and
I think the docs are wrong.

http://docs.python.org/tutorial/interactive.html#key-bindings

The "more capable startup file" example given claims:

# Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).

but I have tried it, and it doesn't seem to actually bind autocomplete to
anything.

Is this a documentation bug, or am I doing something wrong?
 
P

Peter Otten

Steven said:
I'm reading the part of the tutorial that talks about tab-completion, and
I think the docs are wrong.

http://docs.python.org/tutorial/interactive.html#key-bindings

The "more capable startup file" example given claims:

# Add auto-completion and a stored history file of commands to your Python
# interactive interpreter. Requires Python 2.0+, readline. Autocomplete is
# bound to the Esc key by default (you can change it - see readline docs).

but I have tried it, and it doesn't seem to actually bind autocomplete to
anything.

Is this a documentation bug, or am I doing something wrong?

I've just tried it on Kubuntu's konsole. I see strange reactions:
After typing "imp" I have to hit ESC three times before "ort" is added, and
afterwards a character is swallowed. However, I can get the expected
behaviour after binding the key explicitly with

I'm not sure whether Python is to blame or Ubuntu; it may be an interference
with konsole's key bindings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top