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

feat: add utility functions to OrderedSet #3833

Merged

Conversation

harkal
Copy link
Collaborator

@harkal harkal commented Mar 5, 2024

What I did

Added support for:

  1. Convenience method to get the first member
  2. Computing the intersection operation on any number of sets

How I did it

How to verify it

Commit message

Add utility methods to OrderedSet()

  • first()
  • intersection() (class method)

Description for the changelog

Cute Animal Picture

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

@harkal harkal added this to the v0.4.0 milestone Mar 5, 2024
@harkal harkal self-assigned this Mar 5, 2024
@charles-cooper
Copy link
Member

Do you need to explicitly implement iter? Seems like it should inherit from dict

@codecov-commenter
Copy link

codecov-commenter commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 28.57143% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 85.99%. Comparing base (8d34e74) to head (a0033bc).

Files Patch % Lines
vyper/utils.py 28.57% 10 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3833      +/-   ##
==========================================
- Coverage   86.10%   85.99%   -0.12%     
==========================================
  Files          92       92              
  Lines       13821    13833      +12     
  Branches     3052     3056       +4     
==========================================
- Hits        11901    11895       -6     
- Misses       1482     1500      +18     
  Partials      438      438              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@harkal harkal force-pushed the feature/orderedset_utility_functions branch from 01eae12 to a9b97b3 Compare March 5, 2024 08:54
@harkal harkal force-pushed the feature/orderedset_utility_functions branch from a9b97b3 to c7489e2 Compare March 5, 2024 08:56
@harkal
Copy link
Collaborator Author

harkal commented Mar 5, 2024

Do you need to explicitly implement iter? Seems like it should inherit from dict

You are right, we don't... :/

vyper/utils.py Outdated Show resolved Hide resolved
@charles-cooper charles-cooper changed the title feat: Add utility functions to OrderedSet() feat: add utility functions to OrderedSet Mar 5, 2024
@charles-cooper charles-cooper enabled auto-merge (squash) March 5, 2024 16:52
@charles-cooper charles-cooper merged commit 327e95a into vyperlang:master Mar 5, 2024
84 checks passed
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