short path evaluation, why is f() called here: dict(a=1).get('a', f())

aspineux aspineux at gmail.com
Mon Jan 14 13:39:56 EST 2008


This append in both case

dict(a=1).get('a', f())
dict(a=1).setdefault('a', f())

This should be nice if f() was called only if required.

Regards.




More information about the Python-list mailing list