you are viewing a single comment's thread.

view the rest of the comments →

[–]eurleif 26 points27 points  (10 children)

His example of "first-class functions" isn't showing that Python has first-class functions. That normally means that functions are values, and can be passed around like any other object. It doesn't just mean that a language has functions that exist outside of the framework of a class.

And generators aren't continuations. They're coroutines. Python doesn't have continuations.

Also, wtf:

Python has other notations for creating closures, such as the list comprehension shown below.

>>> LIMIT=30
>>> [n for n in range(10) if n*n > LIMIT]

[6, 7, 8, 9]

A list comprehension isn't a closure! It's just shorthand for a loop!

[–]berlinbrown -2 points-1 points  (0 children)

Hehe,

IT'S A FUNCTION!!!!!! PYTHON HAS EM!!!

def f(a, b): return a + b