RE: [PyCrust] FW: underscore kills command completion
Brought to you by:
pobrien
From: Patrick K. O'B. <po...@or...> - 2002-02-06 13:28:00
|
That solves one problem, but creates another. Apply the change and then run PyCrust and type: >>> shell._ This matches nothing, while this: >>> filling._ Matches just fine. (Well, sort of. See below.). Both objects have attributes with leading underscores at the end of their lists. Here are some more examples: >>> ''._ (fails) >>> []._ (succeeds on most, but fails to match on >>> [].__d) >>> {}._ (succeeds, sort of, but fails to match on >>> {}.__cmp) Something is still broken in the search routine. Any chance a linear search would be good enough for what is usually a fairly reasonable sized list? --- Patrick K. O'Brien Orbtech > -----Original Message----- > From: pyc...@li... > [mailto:pyc...@li...]On Behalf Of Neil > Hodgson > Sent: Wednesday, February 06, 2002 5:48 AM > To: po...@or...; Kevin Altis; pycr > Subject: Re: [PyCrust] FW: underscore kills command completion > > > 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 > > > > _______________________________________________ > PyCrust-users mailing list > PyC...@li... > https://lists.sourceforge.net/lists/listinfo/pycrust-users |