[Idle-dev] Small patch to AutoExpand.py
Mark Hammond
mhammond@skippinet.com.au
Thu, 2 Mar 2000 10:40:15 +1100
While using the auto-expand feature, it struck me that it really should also
match against builtin names.
Eg, if I enter "Index" and select auto-complete, IndexError should appear,
even if it doesnt exist in the source file.
Does anyone else agree?
If so, here is a patch :-)
Mark.
===================================================================
RCS file: /home/cvsroot/PyWin32/Pythonwin/pywin/idle/AutoExpand.py,v
retrieving revision 1.1
diff -r1.1 AutoExpand.py
67,68d66
< if not wbefore and not wafter:
< return []
83a82,85
> # Add builtin names.
> bi_filter = lambda name, word=word : string.find(name, word)==0
> bi_names = filter(bi_filter, __builtins__.keys())
> words.extend(bi_names)