-
Notifications
You must be signed in to change notification settings - Fork 1
Implement map builtin function
#64
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
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
map builtin function
samuelcolvin
left a comment
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.
also needs tests for more error cases
| for (k, v) in kwargs { | ||
| k.drop_with_heap(heap); | ||
| v.drop_with_heap(heap); | ||
| } |
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.
| for (k, v) in kwargs { | |
| k.drop_with_heap(heap); | |
| v.drop_with_heap(heap); | |
| } | |
| kwargs.drop_with_heap(heap); |
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.
nice. we can do the same in zip, sorted, min_max, etc
| for v in positional { | ||
| v.drop_with_heap(heap); | ||
| } |
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.
| for v in positional { | |
| v.drop_with_heap(heap); | |
| } | |
| positional.drop_with_heap(heap); |
also positional should probably be called args.
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.
This PR should help clean up how we drop items: #69
This PR implements the
map()builtin function that applies a function to items from one or more iterables, returning a list of results.Note: it stops at the shortest iterable when multiple are provided. Currently, it only supports builtin functions and the
strict=parameter is not yet supported