Skip to content

Implement comprehensive Python set operations transpilation#470

Open
yaskhan wants to merge 4 commits into
mainfrom
feat/set-operations-17434249445235205561
Open

Implement comprehensive Python set operations transpilation#470
yaskhan wants to merge 4 commits into
mainfrom
feat/set-operations-17434249445235205561

Conversation

@yaskhan
Copy link
Copy Markdown
Owner

@yaskhan yaskhan commented Mar 18, 2026

Implement comprehensive Python set operations transpilation.

Key changes:

  • Enhanced the static analyzer to support set type inference in TypeInferenceVisitorMixin and TypeInferenceUtilsMixin.
  • Fixed set initialization to use py_set_from_list helper for iterable arguments in calls_builtin.py.
  • Mapped Python set methods (add, discard, remove, pop, clear, union, intersection, difference, symmetric_difference, update, intersection_update, difference_update, symmetric_difference_update, issubset, issuperset, isdisjoint) to V constructs or specialized generic V helpers in calls_methods.py.
  • Implemented set comparison operators (<, <=, >, >=) using py_set_subset and py_set_strict_subset helpers in operators.py.
  • Added a full suite of set-related V helper functions in module.py.
  • Updated main.py to register the new set helpers for global generation.
  • Added a comprehensive test file test_set_full_ops.py and verified all existing set tests pass.

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

google-labs-jules Bot and others added 4 commits March 18, 2026 14:16
Replaced the incorrect transpilation of Python's `any()` and `all()` to non-existent native V methods `.any(it)` and `.all(it)`.

Changes:
- Implemented `py_any[T](a []T) bool`, `py_all[T](a []T) bool`, and `py_bool(val Any) bool` generic V helper functions.
- Updated `calls_generators.py` to use these helpers.
- Handled generator expressions by transpiling them to boolean arrays via `.map()`.
- Updated unit tests.

Co-authored-by: yaskhan <3676373+yaskhan@users.noreply.github.com>
…4238494311840928636

Fix any() and all() transpilation to V
…69514009004

Fix missing py_repr helper injection in f-strings and built-in calls
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.

@yaskhan yaskhan force-pushed the main branch 3 times, most recently from 592f0b8 to db8e305 Compare March 18, 2026 16:30
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