4 ms·
That's awful What are people expecting with that?
by raverbashing 9y ago
That's awful
What are people expecting with that?
- avip 9y agoThey expect to have some form of "lazy caching": conf = {} def get_conn(): return conf.setdefault("db_conn", expensive_creation_of_db_conn())
- tomjakubowski 9y agoProbably expecting something like you get from collections.defaultdict: "dict subclass that calls a factory function to supply missing values": https://docs.python.org/2/library/collections.html#collections.defaultdict https://docs.python.org/2/library/collections.html#collectio...