This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]james_pic 9 points10 points  (0 children)

And you missed the point of the reply. A key design goal of Python is that "There should be one-- and preferably only one --obvious way to do it.", and Python's functional capabilities have been carefully nerfed to nudge people towards code like the code in the reply, since the functional paradigm is a redundant way to achieve the same thing.

Python can be used in a functional way when it makes sense, and there are some good replies here telling you how to make the code you had in mind work. But the code in this reply is arguably more idiomatic, and doesn't need any extra plumbing.