Compute matches when text contains a dot. Assuming the text is of the form NAME.NAME....[NAME], and is evaluatable in self.namespace or self.global_namespace, it will be evaluated and its attributes (as revealed by dir()) are used as possible completions. (For class
(self, text)
| 1188 | return matches |
| 1189 | |
| 1190 | def attr_matches(self, text): |
| 1191 | """Compute matches when text contains a dot. |
| 1192 | |
| 1193 | Assuming the text is of the form NAME.NAME....[NAME], and is |
| 1194 | evaluatable in self.namespace or self.global_namespace, it will be |
| 1195 | evaluated and its attributes (as revealed by dir()) are used as |
| 1196 | possible completions. (For class instances, class members are |
| 1197 | also considered.) |
| 1198 | |
| 1199 | WARNING: this can still invoke arbitrary C code, if an object |
| 1200 | with a __getattr__ hook is evaluated. |
| 1201 | |
| 1202 | """ |
| 1203 | return self._attr_matches(text)[0] |
| 1204 | |
| 1205 | # we simple attribute matching with normal identifiers. |
| 1206 | _ATTR_MATCH_RE = re.compile(r"(.+)\.(\w*)$") |
no test coverage detected