Skip to content

LRU Cache should implement Mapping interface? #147

@corranwebster

Description

@corranwebster

It would be straightforward to add methods so that the LRUCache class implements the Mapping (or perhaps even MutableMapping) interface which would make it useful in a wider context. The key missing functionality is __iter__, which seems like a reasonable thing to be able to ask (ie. iterate over everything in the cache to do something); there are some questions around locking that may need to be sorted out (probably want to lock for the duration of the iteration, but that may be awkward, alternative is to copy and iterate on the copy).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions