Functional Python Programming
docs.python.org
Functional Python Programming
1–10 of 105 posts
Re: Functional Python Programming
#2Re: Functional Python Programming
#3How new is this? Seems like there is more functional tools in Python than I remember. Didn't see the new 'match' statement in this doc.
Re: Functional Python Programming
#4Much time has passed and I hope I'm a more aware and open-to-new-things person today :) I use Python these days though in a traditional procedural / OO way. This post reminded me that maybe I should look into writing it functional-style. Thankyou!
Re: Functional Python Programming
#5How new is this? Seems like there is more functional tools in Python than I remember. Didn't see the new 'match' statement in this doc.
Is the match-case statement a functional concept? I see it in functional languages but I'm not sure it is inherently functional...
Re: Functional Python Programming
#6Re: Functional Python Programming
#7Earlier quoted context omitted.
Is the match-case statement a functional concept? I see it in functional languages but I'm not sure it is inherently functional...
functional I can't say, but match was highly related to structural typing which was very much central in FP/LP culture
Re: Functional Python Programming
#8The core of functional programming is about avoiding mutable states, not much about anonymous functions or passing functions as data.
To do proper functional programming in Python, there should be IMO:
- a way to enforce non-mutable variables/objects;
- non-mutable collections;
- proper support for recursion and tail-recursion optimization;
- a better syntax for anonymous functions than single statement lambdas.
Generators are nice, but do not have much to do with functional programming.
Re: Functional Python Programming
#9Re: Functional Python Programming
#10Sadly, Python is a pretty poor functional language. The core of functional programming is about avoiding mutable states , not much about anonymous functions or passing functions as data. To do proper functional programming in Python, there should be IMO: - a way to enforce non-mutable variables/objects; - non-mutable collections; - proper support for recursion and tail-recursion optimization; - a better syntax for an…