-
-
Notifications
You must be signed in to change notification settings - Fork 788
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 ternary operator #3398
Conversation
side effects should be lazily evaluated.
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #3398 +/- ##
==========================================
+ Coverage 88.92% 88.96% +0.04%
==========================================
Files 86 86
Lines 10726 10760 +34
Branches 2440 2443 +3
==========================================
+ Hits 9538 9573 +35
- Misses 787 788 +1
+ Partials 401 399 -2
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Moar test cases, but looks solid
in case we ever use custom grammar or something
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.
We should maybe add a nested test as well. I plan to use nested ternary operators in my Merkle multiproof contract here:
b = (leaves[leaf_pos] if leaf_pos < leaves_length else hashes[hash_pos]) if flag else proof[proof_pos]
It's right here: https://github.com/vyperlang/vyper/pull/3398/files#diff-59aca5215be5acc4bc64451f64da58d8a2e777bd306a104dfa07a0db6ca34771R237 |
Oh missed that one - awesome! |
What I did
fix #3055
How I did it
How to verify it
Commit message
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture