cs_lang:python:things-to-know:lazy-vs-eager
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
cs_lang:python:things-to-know:lazy-vs-eager [2013/01/23 14:51] – created cedric | cs_lang:python:things-to-know:lazy-vs-eager [2013/01/23 15:01] (current) – cedric | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Lazy vs Eager evaluation | + | ====== |
- | Python generally uses a eager evaluation (in contrary to Haskell). | + | Python generally uses an eager evaluation (in contrary to [[cs_lang: |
<code python> | <code python> | ||
Line 11: | Line 11: | ||
</ | </ | ||
- | This was not the case with Python 2: | + | This was not the case with Python 2 (without iterators): |
<code python> | <code python> | ||
>>> | >>> | ||
Line 19: | Line 19: | ||
3 | 3 | ||
</ | </ | ||
+ | |||
+ | Lazy evaluation saves execution time for large ranges. |
cs_lang/python/things-to-know/lazy-vs-eager.1358949116.txt.gz · Last modified: 2013/01/23 14:51 by cedric