Home:ALL Converter>What makes Python not a functional programming language?

What makes Python not a functional programming language?

Ask Time:2019-01-10T08:21:07         Author:franklin

Json Formatter

Python variables are duck typed, mutable and it's functions can be written to have side effects. (In other words, it has a lot of non-functional programming features.)

However, it also has first-class functions and yet it's not a functional programming language. So I guess it must be true that a programming language can have functional aspects (or aspects of another language paradigm) even if it does not fall into that paradigm. What exactly makes Python not a functional programming language? Is it a test of whether it has a single characteristic or more of a test of multiple things? (If the former, what is the single aspect that makes Python non-functional or the single aspect that makes Haskell functional?)

Author:franklin,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54120369/what-makes-python-not-a-functional-programming-language
Carcigenicate :

Python is considered functional; if you can trust Wikipedia:\n\n\n Paradigm Multi-paradigm: functional, imperative, object-oriented, reflective\n\n\nEmphasis mine. This is from the summary side-bar.\n\nAnd it should be noted that the \"FP-ness\" of a language isn't binary, it's on a continuum. Python doesn't have built in support for efficient manipulation of immutable structures as far as I know. That's one large knock against it, as immutability can be considered a strong aspect of FP. It also doesn't support tail-call optimization, which can be a problem when dealing with recursive solutions. As you mentioned though, it does have first-class functions, and built-in support for some idioms, such as map/comprehensions/generator expressions, reduce and lazy processing of data.\n\nIf you want to deal exclusively with functional programming idioms, Python may not be the best choice. That alone doesn't exclude it from being considered a functional language though.",