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

Paul Rubin http
Tue Jan 15 13:19:07 EST 2008


aspineux <aspineux at gmail.com> writes:
> Nice idea, but if I want args I need to write it like that:
> 
> x=d.get('a', defaultfunc=f, funcargs=(1,2,3))

Yeah, that looks good.  The default arg to f should be the key being
looked up.



More information about the Python-list mailing list