-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Add zeroing function for arrays #1676
Add zeroing function for arrays #1676
Conversation
6cf59b9
to
5a09d40
Compare
e159288
to
fef941a
Compare
Edit: moved discussion back to issue |
can you rebase on master? |
@fubuloubu is this because you force pushed to master 😂 ? in the future can we protect master from all pushes except from PRs? |
Maybe, that wasn't the commit that was lost though |
5dc0878
to
49ab516
Compare
49ab516
to
e460637
Compare
132cb83
to
a70257f
Compare
some work on the gas estimator is still needed |
Rebase on master to get updated CI |
ee5f52a
to
37c8cbc
Compare
I fixed it. |
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.
LGTM
Still want to discuss the naming though. I dislike clear
Meeting notes: Change to |
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.
Can we get this merged (see above renaming, then ✔️ ) ? 🚀
What would be pythonic is something like |
@michwill the later would be the better choice, but we had a very long conversation about this and enabling the Pythonic list comprehension syntax is a rabbit hole, plus |
This pull request introduces 3 alerts when merging 47d07b8 into e27fd81 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 8fdb472 into e27fd81 - view on LGTM.com new alerts:
|
this handles the transformation from None to 0 for base types.
This pull request introduces 3 alerts when merging dbb078a into e27fd81 - view on LGTM.com new alerts:
|
dbb078a
to
c9f935d
Compare
Codecov Report
@@ Coverage Diff @@
## master #1676 +/- ##
==========================================
+ Coverage 86.55% 86.67% +0.12%
==========================================
Files 55 55
Lines 6343 6335 -8
Branches 1630 1629 -1
==========================================
+ Hits 5490 5491 +1
+ Misses 551 543 -8
+ Partials 302 301 -1
Continue to review full report at Codecov.
|
This pull request introduces 1 alert when merging c9f935d into e27fd81 - view on LGTM.com new alerts:
|
vyper/functions/functions.py
Outdated
) | ||
def empty(expr, context): | ||
if len(expr.args) != 1: | ||
raise ParserException('function expects two parameters.', expr) |
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.
raise ParserException('function expects two parameters.', expr) | |
raise ArgumentException('function expects one parameter.', expr) |
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.
I think ArgumentException
is the most fitting exception to raise here. ParserException
implies that the code can't be parsed. It also doesn't support annotation.
I'm OK merging this with the caveat that users might have some trouble passing empty to and from functions. The compiler will probably just complain. Should be fixed once arg packing / unpacking is refactored. |
vyper/functions/functions.py
Outdated
) | ||
def empty(expr, context): | ||
if len(expr.args) != 1: | ||
raise ParserException('function expects two parameters.', expr) |
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.
I think ArgumentException
is the most fitting exception to raise here. ParserException
implies that the code can't be parsed. It also doesn't support annotation.
hello, how can I use empty to mimic solidity's looks like vyper.exceptions.CompilerPanic: Unsupported location: None Please create an issue.vyper.exceptions.CompilerPanic: Unsupported location: None Please create an issue. |
@or2008 can you do us a favor and create a new issue with the source code that is giving you the problem? Thanks! |
sure, opened #2112 |
What I did
How I did it
How to verify it
See tests
Description for the changelog
Cute Animal Picture