Fork me on GitHub
David Vujic08:10:47

Inspired by the functional abilities of the toolz Python library, here’s a post:


Yes I have successfully used toolz. Its not as versatile as ramda(js counterpart), but its ok fp lib with some basic stuff. However the problem with fp in python is not only lack of low level libs/idioms. The bigger problem are frameworks and things that are heavily dependant on oop constructs and there are many of those, essentially your only choice becomes writting functional interfaces to those.


I think the roots of it are actually cultural. Guido on many occasions made wild claims about fp and I think anybody who otherwise would be trying to push a bit of fp, sort of gave up on this concept. For comparison in js world there is vibrant fp scene, it often started as a bit of disconnected fragment from the rest, but over the years it got adoption and started to affect bigger env. Now I would say fp is becoming defacto mainstream for libs - react, graphql etc. Python has lost a lot due to its early discouragement of fp.

David Vujic10:10:12

Glad to hear that toolz seems to be a good option. And I agree about FP and the cultural aspects of Python. There’s almost always “functional programming is possible, but … pythonic, you know”