John J. Lee
jjl at pobox.com
Thu Jul 31 19:01:51 CEST 2003
Tino Lange <tl_news at nexgo.de> writes:
> This is not what I expected - why evaluate the second argument if it's
> not needed?
Because that's the way Python always does function calls?
> Is this really by design?
> If there's a complicated, expensive to
> calculate/build 2nd argument (maybe a function call) then it's also
> quite ineffective to evaluate it just to throw away...
Don't, then. :-) Use key in dict, or dict.has_key(key).
More information about the Python-list