@@ -38,12 +38,6 @@ class DefaultConfig:
3838 complex : ANSIColors .BOLD_YELLOW ,
3939 bool : ANSIColors .BOLD_YELLOW ,
4040 }
41- # Fallback to look up colors by `isinstance` when not matched
42- # via color_by_type.
43- color_by_baseclass = [
44- ((BaseException ,), ANSIColors .BOLD_RED ),
45- ]
46-
4741
4842 def setup (self ):
4943 import _colorize
@@ -60,10 +54,6 @@ class Completer(rlcompleter.Completer):
6054 Optionally, display the various completions in different colors
6155 depending on the type.
6256 """
63-
64- DefaultConfig = DefaultConfig
65- config_filename = '.fancycompleterrc.py.xxx'
66-
6757 def __init__ (self , namespace = None , Config = DefaultConfig ):
6858 rlcompleter .Completer .__init__ (self , namespace )
6959 self .config = Config ()
@@ -193,14 +183,7 @@ def colorize_matches(self, names, values):
193183
194184 def color_for_obj (self , i , name , value ):
195185 t = type (value )
196- color = self .config .color_by_type .get (t , None )
197- if color is None :
198- for x , _color in self .config .color_by_baseclass :
199- if isinstance (value , x ):
200- color = _color
201- break
202- else :
203- color = ANSIColors .RESET
186+ color = self .config .color_by_type .get (t , ANSIColors .RESET )
204187 # hack: prepend an (increasing) fake escape sequence,
205188 # so that readline can sort the matches correctly.
206189 N = f"\x1b [{ i :03d} ;00m"
0 commit comments