-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Option.take()
for swapping with None
#809
Conversation
Example use case, measure without changing array indexing ```python @guppy def measure_option(ar: array[Option[qubit], N], index: int) -> bool: return measure(take(ar[index])) ```
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #809 +/- ##
==========================================
- Coverage 93.09% 93.06% -0.04%
==========================================
Files 71 71
Lines 8478 8484 +6
==========================================
+ Hits 7893 7896 +3
- Misses 585 588 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a side comment, what was the rationale behind using nothing
in Guppy's option type as opposed to None
?
to avoid confusion with python's Guppy uses |
🤖 I have created a release *beep* *boop* --- ## [0.16.0](v0.15.0...v0.16.0) (2025-02-19) ### ⚠ BREAKING CHANGES * `CompiledGlobals` renamed to `CompilerContext` ### Features * add `Option.take()` for swapping with None ([#809](#809)) ([9a459d5](9a459d5)) ### Code Refactoring * Stop inlining array.__getitem__ and arrary.__setitem__ ([#799](#799)) ([bb199a0](bb199a0)), closes [#786](#786) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Example use case: measure without changing array indexing