Find all attributes of module 'path' that start with 'prefix'.
(self, path: str, prefix: str)
| 167 | and module_info.module_finder.path == self._stdlib_path) |
| 168 | |
| 169 | def find_attributes(self, path: str, prefix: str) -> tuple[list[str], CompletionAction | None]: |
| 170 | """Find all attributes of module 'path' that start with 'prefix'.""" |
| 171 | attributes, action = self._find_attributes(path, prefix) |
| 172 | # Filter out invalid attribute names |
| 173 | # (for example those containing dashes that cannot be imported with 'import') |
| 174 | return [attr for attr in attributes if attr.isidentifier()], action |
| 175 | |
| 176 | def _find_attributes(self, path: str, prefix: str) -> tuple[list[str], CompletionAction | None]: |
| 177 | path = self._resolve_relative_path(path) # type: ignore[assignment] |
no test coverage detected