Tom Ritchford
Apr 7, 2021

--

Fine article!

Consider also dict.setdefault, which has much the same effect.

A lot of the time the dict you are getting came from elsewhere, so you have no choice over its type, but dict.setdefault always works.

Cheers!

--

--

Responses (1)