python: a class that can be used to save key-value pairs