Skip to content

Have a BaseStore class ? #600

@Carreau

Description

@Carreau

Thi is a suggestion to have a BaseStore class or ABC, that store implementations can inherit from to have basic functionality.

Problem description

Saying that stores are "just" MutableMapping may be insufficient, a number of places call methods on stores that are not available in MutableMapping, which:

  • Make static type Checking fails if one uses MutableMapping as a type annotation.
  • Would provide a default methods, like close() method that is no-op, and would avoid the need to check for method existence.
  • Avoid reimplementation of boilerplate :def __len__(self): return len(self.keys()), still allowing overwrite.

Metadata

Metadata

Assignees

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