2 Nov
2018
2 Nov
'18
8:19 a.m.
On Thu, Nov 1, 2018 at 7:23 PM Robert Vanden Eynde
The two are less connected than you seem to think.
Really ? What's the use mainstream use cases for setdefault ? I was often in the case of Alex.
Well, defaultdict configures a default when an instance is created, while setdefault() is used when inserting a value. A major issue IMO with defaultdict is that if you try to *read* a non-existing key it will be inserted. -- --Guido van Rossum (python.org/~guido)