Skip to content

Conversation

Darkheir
Copy link

This PR adds an option to ignore some arguments while generating the cache key.

i.e.

@cache.memoize(50, args_to_ignore=["b"])
def big_foo(a, b):
    return a + b + random.randrange(0, 100000)

assert big_foo(5, 3) == big_foo(5, 2)  # True

@Darkheir Darkheir force-pushed the feat/memoize_ignore_args branch from 1808a57 to f082d5d Compare November 23, 2020 14:29
@coveralls
Copy link

coveralls commented Nov 23, 2020

Coverage Status

Coverage increased (+0.1%) to 78.462% when pulling f082d5d on Darkheir:feat/memoize_ignore_args into 9e1b157 on sh4nks:master.

@sh4nks sh4nks merged commit 0ee6b4a into pallets-eco:master Dec 18, 2020
@sh4nks
Copy link
Collaborator

sh4nks commented Dec 18, 2020

Looks good. Thanks for your contribution!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants