8 ms·
I disagree. I mean sure, you can write something akin to functional programs in python, but the language as a whole is "mutability first" to a very large degree
by bjoli 6y ago
I disagree. I mean sure, you can write something akin to functional programs in python, but the language as a whole is "mutability first" to a very large degree.
From almost every language I have used, I find python one of the furthest from my idea of functional programming (which means different things to different people). Which, in my mind, also makes it a pretty darn useless ML. It is a fine language on its own, but understanding it in terms of lisp (or even worse, scheme) or, say, standard ML is a not very useful.
I think a good exercise regarding this is trying to write YOUR-FAVOURITE-LANGUAGE in ANOTHER-LANGUAGE.
Writing idiomatic scheme in standard ML is surprisingly straightforward. Writing scheme in python is awful, regardless of functools.
- maweki 6y agoFunctional Python for me breaks down with the lazyness of generators. Sure, map returns a generator and that's fine. But you can't pass the result to multiple consumers as the generator has an internal state. It's like a weird version of linear types where every value is only allowed to be used once.
- a-dub 6y agoyeah, it became less fun in python 3.