From ca83c22c9ca76a745ed8102432bb2dc7ee7e3e40 2007-07-09 09:32:29 From: vivainio Date: 2007-07-09 09:32:29 Subject: [PATCH] apply Matthew Neeley's patch to sort the attribute names properly when the dupes have been removed --- diff --git a/IPython/completer.py b/IPython/completer.py index 597e99d..2544b04 100644 --- a/IPython/completer.py +++ b/IPython/completer.py @@ -241,7 +241,8 @@ class Completer: if may_have_dupes: # eliminate possible duplicates, as some traits may also # appear as normal attributes in the dir() call. - words = set(words) + words = list(set(words)) + words.sort() # filter out non-string attributes which may be stuffed by dir() calls # and poor coding in third-party modules diff --git a/doc/ChangeLog b/doc/ChangeLog index b951e57..19c7c71 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,12 @@ +2007-07-09 Ville Vainio + + * completer.py: Applied Matthew Neeley's patch: + Dynamic attributes from trait_names and _getAttributeNames are added + to the list of tab completions, but when this happens, the attribute + list is turned into a set, so the attributes are unordered when + printed, which makes it hard to find the right completion. This patch + turns this set back into a list and sort it. + 2007-07-06 Fernando Perez * IPython/OInspect.py (Inspector.pinfo): Add support for new-style