Re:A Hodgepodge of Python
by BrandonM on Thursday September 15, 2011 @09:01PM
(#3002712)
get() doesn't create a value in the dictionary, though; it only returns a default value. For what you describe, you would want setdefault(). It works here because you're assigning a value to a['foo'] after get()ing the default value.
[ Parent
| on HN ]
There are no comments on this comment yet.