Continuing the OP's top posting style.. if not hasattr(d,key): d[key] = <long computation> return d[key] or variations, including try:...except:.. work for that Zac Burns wrote: > For one, it could be used to cache function calls. >> While I don't disagree in principle, giving an example use-case would >> probably help.