Re:Why did Microsoft invest so much in F#?
by popleft on Monday November 08, 2010 @05:18PM
(#1884268)
See collections.defaultdict in the standard library -- http://docs.python.org/library/collections.html#collections....
try: value = dict['foo'] except KeyNotFound: value = do_something_interesting() dict['foo'] = value
If you could pass a function in as a default of course this point is moot!