[Python-Dev] lazy evaluation redux (was dict "setdefault". Feaure
request or bugfix?)
Jesus Cea Avion
jcea@argo.es
Tue, 11 Feb 2003 15:20:11 +0100
> OK, you want "lazy evaluation", but only in a very specific case.
Specific but intuitive, useful and efficient, nevertheless.
> MUST continue to ensure each of a and b is called before
> whatever is -- both for backwards compatibility AND to respect
> the principle of least astonishment
Well, that a dict's "setdefault" method invokes the argument function
only when necessary is far more intuitive and logical to me than current
situation. In fact there are already precendents, like boolean AND
construction, for example. Or the vary same "zip" built-in lazy
parameters evaluation works, for example.
Yes, lazy evaluation should be very useful although generators and
iterators helps a lot. But it is not the point that I'd like to study
here :-).
By the way, thanks for your (and David Ascher) "Python CookBook". I only
read 1/3 so far, but my money is already well paid :-). Last night I
went to bet at 4:30 in the morning... };-)
--
Jesus Cea Avion _/_/ _/_/_/ _/_/_/
jcea@argo.es http://www.argo.es/~jcea/ _/_/ _/_/ _/_/ _/_/ _/_/
_/_/ _/_/ _/_/_/_/_/
PGP Key Available at KeyServ _/_/ _/_/ _/_/ _/_/ _/_/
"Things are not so easy" _/_/ _/_/ _/_/ _/_/ _/_/ _/_/
"My name is Dump, Core Dump" _/_/_/ _/_/_/ _/_/ _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz