As others have said, this can be implemented in any way. Perhaps the most trivial is defaultdict , although this will add keys to the search:
import time from collections import defaultdict with_hidden_key = defaultdict(time.time, { "foo": 123, "bar": 1024, "bash": "YOLO", })
list(with_hidden_key) #>>> ['foo', 'bar', 'bash'] with_hidden_key["time"] #>>> 1433546635.5777457 list(with_hidden_key) #>>> ['foo', 'bar', 'time', 'bash']
Features depend on what is actually happening.
source share