New submission from Nicolas <[email protected]>:
The function set by readline.set_completer must return one completion per call.
This should be great if we can return an iterable, because with current
implementation I have to write a wrapper:
cache = None
def completer(text, state):
if cache:
if len(cache) > 0:
return cache.pop(0)
else:
cache = None
return None
res = completer_returning_iterable(text)
if isinstance(res, str) or res == None:
return res
cache = res
return completer(text, state)
readline.set_completer(completer)
And completer_returning_list, the true completer, returns a pythonic iterable
for all possible completion.
----------
components: Library (Lib)
messages: 152703
nosy: nicolas_49
priority: normal
severity: normal
status: open
title: readline completer could return an iterable
type: enhancement
versions: Python 3.1
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue13946>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com