33#
44# All Rights Reserved
55"""
6- Colorful TAB completion for Python prompt
6+ Colorful tab completion for Python prompt
77"""
88from _pyrepl import readline
99from _colorize import ANSIColors
@@ -18,18 +18,18 @@ class DefaultConfig:
1818 use_colors = 'auto'
1919
2020 color_by_type = {
21- types .BuiltinMethodType : ANSIColors .BOLD_TEAL ,
22- types .MethodType : ANSIColors .BOLD_TEAL ,
23- type ((42 ).__add__ ): ANSIColors .BOLD_TEAL ,
24- type (int .__add__ ): ANSIColors .BOLD_TEAL ,
25- type (str .replace ): ANSIColors .BOLD_TEAL ,
21+ types .BuiltinMethodType : ANSIColors .BOLD_CYAN ,
22+ types .MethodType : ANSIColors .BOLD_CYAN ,
23+ type ((42 ).__add__ ): ANSIColors .BOLD_CYAN ,
24+ type (int .__add__ ): ANSIColors .BOLD_CYAN ,
25+ type (str .replace ): ANSIColors .BOLD_CYAN ,
2626
2727 types .FunctionType : ANSIColors .BOLD_BLUE ,
2828 types .BuiltinFunctionType : ANSIColors .BOLD_BLUE ,
2929
3030 type : ANSIColors .BOLD_MAGENTA ,
3131
32- types .ModuleType : ANSIColors .TEAL ,
32+ types .ModuleType : ANSIColors .CYAN ,
3333 type (None ): ANSIColors .GREY ,
3434 str : ANSIColors .BOLD_GREEN ,
3535 bytes : ANSIColors .BOLD_GREEN ,
@@ -48,7 +48,7 @@ def setup(self):
4848
4949class Completer (rlcompleter .Completer ):
5050 """
51- When doing someting like a.b.<TAB >, display only the attributes of
51+ When doing someting like a.b.<tab >, display only the attributes of
5252 b instead of the full a.b.attr string.
5353
5454 Optionally, display the various completions in different colors
@@ -61,10 +61,10 @@ def __init__(self, namespace=None, Config=DefaultConfig):
6161
6262 # XXX: double check what happens in this case once fancycompleter works
6363 if False and hasattr (readline , '_setup' ):
64- # this is needed to offer pyrepl a better chance to patch
65- # raw_input. Usually, it does at import time, but is we are under
64+ # This is needed to offer PyREPL a better chance to patch
65+ # raw_input. Usually, it does at import time, but if we are under
6666 # pytest with output captured, at import time we don't have a
67- # terminal and thus the raw_input hook is not installed
67+ # terminal and thus the raw_input hook is not installed.
6868 readline ._setup ()
6969
7070 if self .config .use_colors :
@@ -178,7 +178,7 @@ def colorize_matches(self, names, values):
178178 for i , name , obj
179179 in zip (count (), names , values )]
180180 # We add a space at the end to prevent the automatic completion of the
181- # common prefix, which is the ANSI ESCAPE sequence.
181+ # common prefix, which is the ANSI escape sequence.
182182 return matches + [' ' ]
183183
184184 def color_for_obj (self , i , name , value ):
0 commit comments