Re: [PyCrust] FW: underscore kills command completion
Brought to you by:
pobrien
From: Neil H. <ne...@sc...> - 2002-02-06 11:48:26
|
Patrick K. O'Brien: > I'm seeing this same problem in Pythoncard with Python 2.2 using the "Proof" > application. But it isn't consistent. For example, the following worked: > > >>> bg.DLG_SZE > > but this failed to match: > > >>> bg.on_ > > The following also worked: > > >>> os.stat_result > > Those "on_" methods don't seem to want to match. I have no idea why. Replace the current sorting in getAttributeNames in introspect.py with attributes.sort(lambda x, y: cmp(x.upper(), y.upper())) so it is converting to upper case rather than lower case and this moves the on_* after on followed by a letter. The autocompletion box is assuming that case insensitive order places the '_' after 'Z', can't find any entries that match and so dies. It uses a binary rather than linear search so misses the on_ earlier. Since it is a binary search, it may sometimes find the on_ even though it is in the wrong place as the binary search depends on order and the order is inconsistent. With case insensitive code, the characters [\]^_` which are located between Z and a have to sort somewhere, so Scintilla puts them after the letters. Neil |