Skip to content

Preserve source regions for function return annotations - #991

Open
itisrmk wants to merge 1 commit into
python-rope:masterfrom
itisrmk:devin/1796143969-patch-return-annotation-regions
Open

itisrmk wants to merge 1 commit into
python-rope:masterfrom
itisrmk:devin/1796143969-patch-return-annotation-regions

Conversation

@itisrmk

@itisrmk itisrmk commented Dec 1, 2026

Copy link
Copy Markdown

Addresses item 3 of #912. Rope's patched AST skipped return annotations, so expression matching could find a node with no source region or fail when an annotation contained a literal parenthesis. Visit the annotation before the function body. The regression checks exact match ranges for both synchronous and asynchronous definitions.

AI disclosure: Devin drafted the patch, regression test, and changelog entry.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant