[IPython-dev] Tab-completion of data/properties and win32com fix for IPython
Fernando.Perez at colorado.edu
Tue Aug 3 19:07:26 CDT 2004
Jaco Schieke wrote:
> Some clarifications:
> 1. The dictionary hack is simply to keep "matches" unique. It took me a
> while to realize this, but pyreadline actually expects an unique array
> (see lib\site-packages\readline\pyreadline.py(788): if r and r not in
> completions:), otherwise it stops reading from the matches returned and
> simply exits. This is not win32 specific and should be a usefull
> addition should be incorporated into rlcompleter.py. An easy way to
> test this is to add matches.sort() just before you return matches in
> FlexCompleter.py. Then try .<tab> ... the results are disappointing.
Mmh, I just tried this and I don't see any problem at all, at least not under
Unix. If this is something which is needed by pyreadline, then that's where
the patch should be directed. But I've never seen Unix readline needing any
of this, so I don't want to add unnecessary functionality.
Sorry, but until you can show me a case where the Unix readline has problems
with this setup, I'd rather not include this patch (and I suspect a similar
answer may come from the rlcompleter crowd). Obviously if you do have a usage
case which shows how this is necessary on all platforms, then I'll gladly
include it (and eventually it should work its way towards rlcompleter, where
it probably really belongs; after all, FlexCompleter shouldn't even exist if
rlcompleter had all we want).
But if the patch belongs in pyreadline (win32), then that's where it should
go, not in ipython.
> 2. I've rewritten the function to check for sys.platform and only run
> win32 hacks if on the right platform - patch follows..
This looks fine. I'll wait until we settle the whole thing before applying
the patch: if it's only going to be the win32 stuff, then I might ask you to
resend me a standalone one so I don't accidentally mess things up applying and
removing unneeded parts.
Also, please heed my comments about patches which I sent yesterday; your patch
from yesterday had hard tabs, and I really prefer attachments created with -u.
Thanks for your efforts, this will eventually go into 0.6.3
More information about the IPython-dev