gitlab-importer · GitHub

In Heptapod by bitbucket_importer on Jun 28, 2015, 22:37

Created originally on Bitbucket by lac

In the command interpreter type:
import readline
readline.parse_and_bind('Control-tab: "import"')

Then type control-tab on the next line. readline should insert import. PyPy 2.7.9 (2.5.1+dfsg-1, Mar 27 2015, 19:45:43) doesn't.

There is an alternative syntax.
readline.parse_and_bind(r'"\C-\t": "import"')

This doesn't work either. Note that CPython Python 2.7.9 (default, Mar 1 2015, 12:57:24)
has bugs over this also, but different ones.
readline.parse_and_bind(r'"\C-\t": "import"') in CPython does nothing.
readline.parse_and_bind('Control-tab: "import"') works
but if you then do
readline.parse_and_bind('tab: "raise"')

both tab and control-tab will be set to insert "raise" by CPython. There seems to be no way to bind control-tab and tab to different things in CPython.

This bug was discovered by Steve D'Aprano in CPython 2.7. He will probably make a CPython bug report about it soon.

Read the original on github.com ↗