
Functional Programming in Python [pdf] - happy-go-lucky
http://www.oreilly.com/programming/free/files/functional-programming-python.pdf
======
fermigier
Shameless plug, if you are interested in functional programming in Python:

[https://github.com/sfermigier/awesome-functional-
python](https://github.com/sfermigier/awesome-functional-python)

(PR welcome).

------
benji-york
Readers may be interested in the functional superset of Python called Coconut
([http://coconut-lang.org](http://coconut-lang.org)). Playing with it casually
has been great fun.

~~~
srean
Very interesting, thanks. Wondering if Cython would have been a better
compilation target. It would still stay usable from CPython.

------
bhnmmhmd
Is Python fully capable and suitable for functional programming?

~~~
xapata
Yes. A function is an object just like any other. What more do you need?

If you say macros, I'd argue that's not quite the same as "functional".

~~~
Waterluvian
Lots of easy handling of structures immutably. Which Python has a good bit of
for sure, with comprehension especially. But I could use more. :)

I wish everything immutablejs gave me was built in to Python. :)

~~~
xapata
Comparing with immutablejs, there are 4 broad categories that match: lists,
dicts, sets, and iterators.

Tuple slicing and concatenation gives you the "immutable" behavior for ordered
data. For sets and dicts, one could create a subclass that override
add/insert/set methods to return a modified copy. Iterators already have
excellent support.

I'm not an immutablejs user, but my first skim of the docs doesn't make it
clear what's missing from Python. If the immutable subclasses would be
valuable, I'll gladly make a module for it. There's already frozenset. A
frozendict didn't seem as useful (according to core devs).

~~~
xapata
Plus, I forgot that sets have nice operators for union, intersection, etc. So
you don't need to override anything there.

------
dmytrish
This is also a good addition for functional programming in Python:

[https://github.com/kachayev/fn.py](https://github.com/kachayev/fn.py)

