Josh Rosenberg added the comment:

I agree the design requiring it to pass the same information over and over is a 
bit odd (I've occasionally had cause to "borrow" some of ipython's niftyness 
for a plain Python terminal, and making custom completers work is one of the 
more awkward parts of the whole process). I'm guessing this is a product of 
conforming overzealously to the C API for readline functions like 
rl_filename_completion_function (see: 
http://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC47 ).

It doesn't seem possible to do this nicely; __next__() on a generic iterator 
won't accept arguments (and practically, one of these arguments is state, the 
other is just "get next"), and trying to catch a TypeError due to the wrong 
number of arguments or using a generator as a string so you switch modes is 
ugly. Either the existing interface spawns additional arguments (also ugly; 
boolean flags that completely change behavior are the last refuge of a 
scoundrel), or a new function is created (possibly deprecating the old one over 
time.

Any suggestions?

----------
nosy: +josh.rosenberg

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13946>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to