Skip to content
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

allow dynamic array iterators #2606

Merged
merged 4 commits into from
Jan 21, 2022

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Jan 17, 2022

What I did

Allow iterators for dynamic arrays, e.g.

xs: DynArray[uint256, 5] = [1,2,3]
for x in xs:
    if x == 2:
        return x
return -1

How I did it

add cases to parse_For_list and refactor to use more general functions

How to verify it

see tests

Description for the changelog

add iterators for dynamic array types

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2022

Codecov Report

Merging #2606 (2b00fb0) into master (fe99778) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 2b00fb0 differs from pull request most recent head 7956b71. Consider uploading reports for the commit 7956b71 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2606   +/-   ##
=======================================
  Coverage   86.58%   86.59%           
=======================================
  Files          91       91           
  Lines        9439     9438    -1     
  Branches     2362     2362           
=======================================
  Hits         8173     8173           
  Misses        777      777           
+ Partials      489      488    -1     
Impacted Files Coverage Δ
vyper/semantics/validation/local.py 92.23% <100.00%> (ø)
vyper/compiler/output.py 94.61% <0.00%> (-0.04%) ⬇️
vyper/codegen/core.py 83.11% <0.00%> (ø)
vyper/codegen/types/types.py 84.92% <0.00%> (+0.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe99778...7956b71. Read the comment docs.

@charles-cooper charles-cooper marked this pull request as ready for review January 21, 2022 17:18
@charles-cooper charles-cooper merged commit 0004e0c into vyperlang:master Jan 21, 2022
@charles-cooper charles-cooper deleted the dyn_array_functions branch January 21, 2022 22:45
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.

3 participants