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

refactor: builtin functions inherit from VyperType #3559

Merged
merged 12 commits into from
Nov 22, 2023

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented Aug 17, 2023

What I did

Builtin functions are currently the remaining types that are not a "VyperType". This PR resolves this inconsistency by making builtin functions inherit from VyperType.

How I did it

Move code around.

How to verify it

See tests

Commit message

chore: make builtin functions vyper types

Builtin functions are currently the remaining types that 
are not a "VyperType". This PR resolves this inconsistency 
by making builtin functions inherit from `VyperType`.

Description for the changelog

Make builtin functions vyper types

Cute Animal Picture

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

vyper/semantics/types/function.py Fixed Show fixed Hide fixed
vyper/semantics/types/function.py Fixed Show fixed Hide fixed
vyper/builtins/functions.py Fixed Show resolved Hide resolved
vyper/builtins/functions.py Fixed Show fixed Hide fixed
@codecov-commenter
Copy link

codecov-commenter commented Aug 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4dd47e3) 89.61% compared to head (a970ce7) 90.21%.
Report is 3 commits behind head on master.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3559      +/-   ##
==========================================
+ Coverage   89.61%   90.21%   +0.60%     
==========================================
  Files          80       79       -1     
  Lines       11343    11257      -86     
  Branches     2553     2544       -9     
==========================================
- Hits        10165    10156       -9     
+ Misses        791      713      -78     
- Partials      387      388       +1     

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

# note special meaning for -1 in validate_call_args API
expect_num_args = (num_args, -1)

validate_call_args(node, expect_num_args, list(self._kwargs.keys()))
Copy link
Collaborator Author

@tserg tserg Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last argument should be a list of names for valid keyword arguments. Previously, it was a dictionary of KwargSettings.

@tserg tserg marked this pull request as ready for review August 18, 2023 03:57
@charles-cooper charles-cooper changed the title chore: make builtin functions vyper types refactor: builtin functions inherit from VyperType Nov 21, 2023
@@ -98,22 +98,22 @@
)

from ._convert import convert
from ._signatures import BuiltinFunction, process_inputs
from ._signatures import BuiltinFunctionT, process_inputs

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
vyper.builtins._signatures
begins an import cycle.
@charles-cooper charles-cooper merged commit aa1ea21 into vyperlang:master Nov 22, 2023
84 checks passed
@tserg tserg deleted the refactor/builtins branch November 23, 2023 01:30
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