-
Notifications
You must be signed in to change notification settings - Fork 265
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
curry memoize
by default.
#146
Conversation
This allows a cache to be provided when using `memoize` as a decorator.
|
||
@curry(memoize, cache={0: 0, 1: 1}) | ||
# Provide a cache with initial values to `memoize`. This works as a decorator | ||
# because `memoize` is curried (see `toolz.curry`) by default. |
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 recommend skipping this explanation. I don't think many of our readers will know that this is strange and the reference to curry
probably makes some people tune out.
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.
Good point. Should I remove the comment in the docstring too?
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 say keep that one.
An argument against this PR is that |
+1 |
Cool. Time to merge? |
Merging. I also want to ping #147 here for reference. |
This allows a cache to be provided when using
memoize
as a decorator.