homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nicolas_49
Recipients nicolas_49
Date 2012年02月05日.19:48:01
SpamBayes Score 0.0004866972
Marked as misclassified No
Message-id <1328471281.77.0.152059916947.issue13946@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012年02月05日 19:48:01nicolas_49setrecipients: + nicolas_49
2012年02月05日 19:48:01nicolas_49setmessageid: <1328471281.77.0.152059916947.issue13946@psf.upfronthosting.co.za>
2012年02月05日 19:48:01nicolas_49linkissue13946 messages
2012年02月05日 19:48:01nicolas_49create

AltStyle によって変換されたページ (->オリジナル) /