what is it, that I don't understand about python and lazy evaluation?
Antoine Pitrou
solipsis at pitrou.net
Thu Aug 13 09:32:29 EDT 2009
Erik Bernoth <erik.bernoth <at> googlemail.com> writes:
>
> Isn't it strange, that this code runs (in a lazy language) for eternity?
Python is a not a lazy language.
`and` and `or` are particular, they are language constructs (*), not operators,
that's why they can decide whether or not to evaluate their second term. It's a
feature, but this feature is not general to Python.
(*) by this I mean they have similar status as, for example, `if` and `else`
More information about the Python-list
mailing list