(
self,
cursor_offset: int,
line: str,
*,
locals_: dict[str, Any] | None = None,
**kwargs: Any,
)
| 614 | return lineparts.current_expression_attribute(cursor_offset, line) |
| 615 | |
| 616 | def matches( |
| 617 | self, |
| 618 | cursor_offset: int, |
| 619 | line: str, |
| 620 | *, |
| 621 | locals_: dict[str, Any] | None = None, |
| 622 | **kwargs: Any, |
| 623 | ) -> set[str] | None: |
| 624 | if locals_ is None: |
| 625 | locals_ = __main__.__dict__ |
| 626 | |
| 627 | attr = self.locate(cursor_offset, line) |
| 628 | assert attr, "locate was already truthy for the same call" |
| 629 | |
| 630 | try: |
| 631 | obj = evaluate_current_expression(cursor_offset, line, locals_) |
| 632 | except EvaluationError: |
| 633 | return set() |
| 634 | |
| 635 | # strips leading dot |
| 636 | matches = (m[1:] for m in self.attr_lookup(obj, "", attr.word)) |
| 637 | return {m for m in matches if _few_enough_underscores(attr.word, m)} |
| 638 | |
| 639 | |
| 640 | try: |
nothing calls this directly
no test coverage detected