On Feb 20, 2006, at 12:38 PM, Aahz wrote:
...
>> Can you say, for the record (since nobody else seems to care), if
>> d.getorset(key, func) would work in your use cases?
>
> Because I haven't been reading this thread all that closely, you'll
> have
> to remind me what this means.
Roughly the same (save for method/function difference) as:
def getorset(d, key, func):
if key not in d: d[key] = func()
return d[key]
Alex
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com