Skip to content

feat: implement PEP 649 / 749 deferred evaluation of annotations#134

Closed
yaskhan wants to merge 4 commits intomainfrom
feature/pep-649-deferred-annotations-16837018923834780642
Closed

feat: implement PEP 649 / 749 deferred evaluation of annotations#134
yaskhan wants to merge 4 commits intomainfrom
feature/pep-649-deferred-annotations-16837018923834780642

Conversation

@yaskhan
Copy link
Copy Markdown
Owner

@yaskhan yaskhan commented Mar 3, 2026

Implemented support for deferred evaluation of __annotations__ (PEP 649 / 749). The transpiler now collects type annotations from module, class, and function levels, and dynamically generates V helper functions (e.g., get_annotations_for_mystruct()) that construct and return a map[string]string. Attribute access (obj.__annotations__) and name access (__annotations__) are mapped to these helpers. This provides the correct expected behavior while saving memory compared to storing map instances on every V struct.


PR created automatically by Jules for task 16837018923834780642 started by @yaskhan

Implemented support for deferred evaluation of `__annotations__` by dynamically generating `get_annotations_for_{name}()` helper functions for modules, classes, and functions, returning `map[string]string`. Modified attribute and name transpilation to map `__annotations__` access to these helpers. Checked off task in `todo2.md`.

Co-authored-by: yaskhan <3676373+yaskhan@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 3 commits March 3, 2026 23:15
Added explicit `Dict[str, str]` annotations to `func_annotations`, `class_annotations`, and `mod_annotations` dictionaries to fix `mypy --check-untyped-defs` CI failures introduced in the PEP 649 / 749 implementation.

Co-authored-by: yaskhan <3676373+yaskhan@users.noreply.github.com>
Co-authored-by: qwencoder <qwencoder@users.noreply.github.com>
@code-input
Copy link
Copy Markdown

code-input Bot commented Mar 3, 2026

Pull request #134 has conflicts that needs to be resolved.
You can resolve it at codeinput: 61e8511f-78cc-4596-8489-2a5f85421653.

@yaskhan yaskhan force-pushed the feature/pep-649-deferred-annotations-16837018923834780642 branch from acc77f1 to 452ca3b Compare March 3, 2026 23:42
@code-input
Copy link
Copy Markdown

code-input Bot commented Mar 3, 2026

Pull request #134 has conflicts that needs to be resolved.
You can resolve it at codeinput: fded88cf-7738-4bc8-845a-c631da9ab3a2.

@yaskhan yaskhan closed this Mar 15, 2026
@yaskhan yaskhan deleted the feature/pep-649-deferred-annotations-16837018923834780642 branch March 15, 2026 17:59
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