120 @param val value to check (object) |
120 @param val value to check (object) |
121 @param word word to ammend (string) |
121 @param word word to ammend (string) |
122 @return ammended word (string) |
122 @return ammended word (string) |
123 """ |
123 """ |
124 if callable(val): |
124 if callable(val): |
125 word = word + "(" |
125 word += "(" |
126 return word |
126 return word |
127 |
127 |
128 def global_matches(self, text): |
128 def global_matches(self, text): |
129 """ |
129 """ |
130 Public method to compute matches when text is a simple name. |
130 Public method to compute matches when text is a simple name. |
139 n = len(text) |
139 n = len(text) |
140 for word in keyword.kwlist: |
140 for word in keyword.kwlist: |
141 if word[:n] == text: |
141 if word[:n] == text: |
142 seen.add(word) |
142 seen.add(word) |
143 if word in {'finally', 'try'}: |
143 if word in {'finally', 'try'}: |
144 word = word + ':' |
144 word += ':' |
145 elif word not in {'False', 'None', 'True', |
145 elif word not in {'False', 'None', 'True', |
146 'break', 'continue', 'pass', |
146 'break', 'continue', 'pass', |
147 'else'}: |
147 'else'}: |
148 word = word + ' ' |
148 word += ' ' |
149 matches.append(word) |
149 matches.append(word) |
150 for nspace in [self.namespace, builtins.__dict__]: |
150 for nspace in [self.namespace, builtins.__dict__]: |
151 for word, val in nspace.items(): |
151 for word, val in nspace.items(): |
152 if word[:n] == text and word not in seen: |
152 if word[:n] == text and word not in seen: |
153 seen.add(word) |
153 seen.add(word) |