cs_lang:python:things-to-know:lazy-vs-eager
This is an old revision of the document!
Lazy vs Eager evaluation
Python generally uses a eager evaluation (in contrary to Haskell).
>>> r = range(10) >>> print(r) range(0, 10) >>> print(r[3]) 3
This was not the case with Python 2:
>>> r = range(10) >>> print r [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> print r[3] 3
cs_lang/python/things-to-know/lazy-vs-eager.1358949133.txt.gz · Last modified: 2013/01/23 14:52 by cedric