Skip to content

Allow cache_it* decorators to provide a way to cache instance methods #24

@SantjagoCorkez

Description

@SantjagoCorkez

That'd be a good option to have cache_it() and cache_it_json() either auto-detecting instance methods or being marked of such a use case by, for example, strip_first_arg boolean parameter that'd perform something like

pickle.dumps(args[1:])

There's a side effect in such a use case, I know, but could be an option for those who know what they do.

In my case, using instance methods eliminates a need to call getLogger every time I need to log something and provides an option to use one, instance-wide, logger (which certainly cannot be pickled because of file descriptors inside any logger object).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions