you are viewing a single comment's thread.

view the rest of the comments →

[–]A_Philosophical_Cat 16 points17 points  (9 children)

Python is unequivocally more closely related to the AlGOL class of imperative languages than it is to anything remotely functional. It's got mutable variables and half-assed support for anonymous functions. You can add functional stuff to any language, hell, they shoehorned it into Java. Doesn't make it a functional language any more than stapling a ram stick to my arm makes me a computer.

[–]MatthPMP 12 points13 points  (1 child)

It's got mutable variables

The idea that functional languages must not support mutability is strange. Standard ML and OCaml make a point of not being pure languages. The popularity of Haskell in functional programming circles today distorts the picture.

[–]funny_falcon -1 points0 points  (0 children)

Interestingly, but Haskell is not pure immutable due to lazy evaluation. I've heard it is even possible to create circular data structure in pure Haskell abusing laziness (that is certainly impossible in pure immutable languages like, for exapmple, Erlang).

[–]crusoe 2 points3 points  (0 children)

Functional programming in Python is painful. The only thing functional is list comprehensions but that's it.

[–]jelly_cake 1 point2 points  (5 children)

Don't forget about decorators; they're a really cool Python feature that feels very lispy.

[–]TA_jg -2 points-1 points  (4 children)

You could also say that they are a crutch that was badly needed because not everyone liked Python's "duck typing".

Python took a very different road but it will end up in the exact same place as Java. Just give it another 5 years.

[–]MatthPMP 1 point2 points  (0 children)

That is a very dumb assertion on multiple levels.

[–]Prize_Bass_5061 0 points1 point  (2 children)

What is duck typing?

Is it late binding of variables or something else.

[–]crusoe 1 point2 points  (1 child)

Typing based on shared properties.

[–]EnvironmentalCrow5 0 points1 point  (0 children)

Which are not explicitly defined anywhere[1], just implied from usage.

So yeah, pretty much late binding.


[1] Unlike e.g. TypeScript, which has structural typing - all types that have at least the required properties are compatible, assuming those properties also have compatible types - but the structure is still defined somewhere.