Repository navigation
Guard type-hint providers and infer X | Y union annotations - #908
Open
marlon-costa-dc wants to merge 6 commits into
Open
marlon-costa-dc wants to merge 6 commits into
marlon-costa-dc wants to merge 6 commits into
Conversation
…e pynames The inheritance provider hands DefinedName pynames (import rebinds) to the type-comment provider, which unconditionally reads pyname.assignments and raises AttributeError; return None so inference falls through to the next composite provider.
The or/| type-hint evaluator raised NotImplementedError, so every completion on a union-annotated name lost both alternatives. Evaluate to a synthesized class exposing the attributes of each alternative, which also un-xfails the hint_or completion test.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #908 +/- ##
=======================================
Coverage 95.44% 95.44%
=======================================
Files 134 134
Lines 26910 26935 +25
=======================================
+ Hits 25685 25709 +24
- Misses 1225 1226 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marlon-costa-dc
added a commit
to marlon-costa-dc/rope
that referenced
this pull request
Nov 7, 2026
Our open python-rope/rope PRs carry tests that the fork release absorbed in behaviour but not in tests. Each passes against the current code: - python-rope#908 test_assignment_hints_ignore_names_that_are_not_assigned - python-rope#909 test_scope_region_rejects_decorator_without_source_positions, test_scope_region_rejects_decorator_without_source_marker - python-rope#920 test_hint_param_on_a_hierarchy_python_refuses - python-rope#910 test_find_module_skips_python_path_files - python-rope#844 test_format_string_region_without_closing_quote_is_rejected Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small type-hinting fixes:
get_class_with_attr_nameand the PEP 484 type-comment provider indexpyname.assignments[0]unconditionally, which raisesAttributeError/ IndexError when a non-AssignedName pyname (a parameter, a match capture, ...) reaches them. Guard withisinstance(pyname, AssignedName).The
or/|hint evaluator raisedNotImplementedError, so completions on union-annotated names lost both alternatives. Evaluate to a synthesized class exposing the attributes of each alternative; this un-xfailstest_hint_orand adds coverage for first-alternative attributes.type_hinting_test: 100 passed locally on 3.13.