Skip to content

Conversation

@goredar
Copy link
Contributor

@goredar goredar commented Feb 18, 2020

Hi, there.

Currently, there is a cache miss when the order of function kwargs is not preserved during several calls. Tried to fix this behavior.

Looking forward to your reply.

@goredar goredar requested a review from lonelyenvoy February 20, 2020 06:34
@lonelyenvoy
Copy link
Owner

Hi Vitaliy,

Thanks for your contribution. Your solution works well!

The only drawback is that the sorting will slow down the make_key function a little bit (~10%). Since it is not a common practice to call a function multiple times with its kwargs in different order, I will add an option to the @cached decorator so that users can decide whether they need this feature.

Cheers!

@lonelyenvoy lonelyenvoy merged commit 0bf6f76 into lonelyenvoy:master Feb 21, 2020
Copy link
Owner

@lonelyenvoy lonelyenvoy left a comment

Choose a reason for hiding this comment

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

Reviewed. Everything is okay.

@goredar
Copy link
Contributor Author

goredar commented Feb 24, 2020

Thanks a lot!

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.

2 participants