Tab completion

Ben Finney ben+python at benfinney.id.au
Thu Apr 2 23:51:47 CEST 2009


Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> writes:

> I like tab-completion, but I'd rather not be reduced to typing
> spaces for indents in the interpreter. What do other people do?

Acknowledge that using U+0009 for indentation is wrong, and use
beautiful U+0020 always.

> The GNU readline library claims that M-tab (which I guess is
> Alt-tab) will enter a tab character.

“M-tab” is Emacs-speak for “<Meta> plus <Tab>”. Not all keyboards
have “Alt”, you see (maybe none, when Emacs first started referring
to the Meta modifier?).

In most terminal programs, you can send “<Alt>-<foo>” also by
pressing “<Esc>, <foo>” (two separate keystrokes in sequence).

> Any other suggestions or hints?

Suck it up and accept the truth! U+0020 is the unambiguous indentation
character that always does what it should, and U+0009 is a horrible
mistake which must be suppressed with extreme prejudice. No true
Pythonista would disagree.

-- 
 \     “No matter how far down the wrong road you've gone, turn back.” |
  `\                                                  —Turkish proverb |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list