Skip to content

ENH: Provide a way to tell if Memory had a cache hit #1342

@larsoner

Description

@larsoner

It would be nice if there were a way to tell if there was a cache hit for memory.cache(func)(*args, **kwargs).

Is this possible already? If so, I can add a PR to add whatever method works to the docs. If it's in the docs already and I missed it, my apologies!

If it's not possible, I'm not sure of a great way to do it. One option would be Memory(..., return_hit=False) where, if True, each call returns out, hit = memory.cache(func)(*args, **kwargs) rather than just returning the out from the func.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions