[STORY-TIME] THE BDFL AND HIS PYTHON PETTING ZOO

Christian Gollwitzer auriocus at gmx.de
Thu Feb 18 16:14:22 EST 2016


Am 16.02.16 um 03:02 schrieb Rick Johnson:
> On Friday, February 12, 2016 at 1:51:35 AM UTC-6, John Ladasky wrote:
>> I like lazy evaluation.
>
> Well, it is a "Pythonic feature" no doubt.


?? I'm confused. Does Python have lazy evaluation? I thought that Python 
does eager evaluation. At least this snippet seems to confirm:

def arg():
	print("Evaluating arg")
	return None

def func(x):
	print("Evluating func")
	print(x)

func(arg())

If I run it, the output is:

Evaluating arg
Evluating func

and I think that with side effects, only eager evaluation is really 
predictable.

	Christian



More information about the Python-list mailing list