[Python-ideas] dict(default=int)

Spencer Brown spencerb21 at live.com
Thu Mar 9 18:04:23 EST 2017


 Might make more sense to be dict.default(int), that way it doesn't have redundant dict names. Only problem is then it might be a bit confusing, since you could do {1:2, 3:4}.default(int) and not get the values back. Maybe 'withdefault', and return a copy if called on the instance?


More information about the Python-ideas mailing list