Message300596
Code such as mydict.setdefault('eggs', []) will needlessly incur the cost of instantiating a list even when 'eggs' is already a valid key in mydict. collections.defaultdict will not do this. detecting and automatically calling "callable" and "type" objects (implicit laziness) would break cases where callables and types are used as first class values.
Add keyword argument: lazy? Thus mydict.setdefault('eggs',list, lazy=True) would generate a new list only when necessary while the default would still be to append a reference to list (first class) objects). |
|
Date |
User |
Action |
Args |
2017-08-20 05:14:06 | jimd | set | recipients:
+ jimd |
2017-08-20 05:14:06 | jimd | set | messageid: <1503206046.25.0.821679783552.issue31240@psf.upfronthosting.co.za> |
2017-08-20 05:14:06 | jimd | link | issue31240 messages |
2017-08-20 05:14:05 | jimd | create | |
|