[issue38420] defaultdict does not support parametric lambda

2019-10-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: All versions below 3.9 are in feature freeze, so they cannot get new features. This requested feature is already supported by subclassing ``dict`` and giving it a ``__missing__`` method. See issue #38315 -- nosy: +steven.daprano resolution: -> reje

[issue38420] defaultdict does not support parametric lambda

2019-10-09 Thread wang xuancong
New submission from wang xuancong : A very common use of defaultdict is that if the key exist, use the corresponding mapped target, if the key does not exist, use the key itself. However, current Python 2/3 defaultdict does not support parametric lambda function: >>> from collections import