3 ms·
My favorite parts of python are the parts more oriented to functional programming (ie. list comprehensions). As I got more of an appetite for functional program
by phren0logy 16y ago
My favorite parts of python are the parts more oriented to functional programming (ie. list comprehensions). As I got more of an appetite for functional programming, I have drifted, because it seems at odds with the direction python is headed (ie. Guido wanting to remove map/reduce).
There have been a few libraries posted here on HN recently about adding functional elements to python, so apparently it's not just me. Maybe it's time for a "functional fork" of python?
- agentultra 16y agoIt's a weird synthesis, but I wouldn't frame it as hostile. A functional programming style has always been at odds in the Python world. OTOH, you have functools and itertools, et al. On the other, classes and a preference for explicit loops. Yet even in Python3 where reduce has been moved around, there's still the spirit of functional programming present. The map, filter, reduce functions all return generators. This is a pretty good improvement as you can now use them on (theoretically) infinite sequences. Yes, lambda is the lame, dead horse. It's just a syntactic issue. I'm sure most people in the Python world would be happy to receive a multi-line lambda that can return more than just an expression. It's just that no one has been happy with any of the syntax proposals to make it happen. However, there are other things about lambda in Python that make it difficult to implement as well. But I think baby steps are important. Is a fork necessary? Well... it would be nice to see some people experimenting with getting lambda to work. However I don't think a fork of the interpreter is necessary just to support a style of programming. Indeed Python prefers one way to do things, but functional programming has proven practical enough I think to be an exception to the rule and so it lives on. Sort of. :)