[New-bugs-announce] [issue10351] to introduce autocompletion for keys in dictionaries (patch attached)

Valery Khamenya report at bugs.python.org
Mon Nov 8 10:22:40 CET 2010


New submission from Valery Khamenya <khamenya at gmail.com>:

1. The patch introduces autocompletion for keys in dictionaries (patch attached)

2. The patched rlcompleter as such works OK for unicode dictionary keys as well. All tests pass OK. HOWEVER, readline's completion mechanism seem to be confused with unicode strings -- see comments to Completer.dict_key_matches(). So, perhaps, one day some changes should be applied to readline code too.

3. rlcompleter.py has no tests in trunk -- I spawn a separate issue for it. Meanwhile I took test_rlcompleter.py from 2.7 and extended it.

4. The following usual lines in .pythonstartup:
import readline
import rlcompleter
readline.parse_and_bind('tab: complete')
readline.parse_and_bind('Control-Space: complete')

should be extended by this one:
readline.set_completer_delims(re.compile(r'[\'"\\[]').sub('', readline.get_completer_delims()))

----------
components: Library (Lib)
files: rlcompleter-dict-keys-autocompletion.tar.gz
messages: 120721
nosy: Valery.Khamenya
priority: normal
severity: normal
status: open
title: to introduce autocompletion for keys in dictionaries (patch attached)
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file19540/rlcompleter-dict-keys-autocompletion.tar.gz

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10351>
_______________________________________


More information about the New-bugs-announce mailing list