Jump to ratings and reviews
Rate this book

Functional Programming in Python

Rate this book
We’d better start with the hardest “What is functional programming (FP), anyway?”

One answer would be to say that functional programming is what you do when you program in languages like Lisp, Scheme, Clojure, Scala, Haskell, ML, OCAML, Erlang, or a few others. That is a safe answer, but not one that clarifies very much. Unfortunately, it is hard to get a consistent opinion on just what functional programming is, even from functional programmers themselves. A story about elephants and blind men seems apropos here. It is also safe to contrast functional programming with “imperative programming” (what you do in languages like C, Pascal, C++, Java, Perl, Awk, TCL, and most others, at least for the most part). Functional programming is also not object-oriented programming (OOP), although some languages are both. And it is not Logic Programming (e.g., Prolog), but again some languages are multiparadigm.

Python is most definitely not a “pure functional programming language”; side effects are widespread in most Python programs. That is, variables are frequently rebound, mutable data collections often change contents, and I/O is freely interleaved with computation. It is also not even a “functional programming language” more generally. However, Python is a multiparadigm language that makes functional programming easy to do when desired, and easy to mix with other programming styles.

51 pages, Kindle Edition

First published May 1, 2015

4 people are currently reading
55 people want to read

About the author

David Mertz

11 books

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
11 (14%)
4 stars
29 (38%)
3 stars
30 (39%)
2 stars
6 (7%)
1 star
0 (0%)
Displaying 1 - 10 of 10 reviews
227 reviews26 followers
August 2, 2015
It's not very much an introduction to functional programming in Python but more an guide on how you can utilize these concepts in Python. The explanation is very good though and even for someone with very limited FP experience it was reasonable easy to follow along (although I didn't get everything).

I can highly recommend this.
1 review
November 3, 2020
You will learn the basic foundation of Functional Programming. This book has only 4 chapters.
For me this most interesting part is the Flow Control chapter. In that chapter I learn how to take the advantage of recursive technique to solve a problem in a good way, by "good way" I mean "How to eat an elephant" and recursive technique make you think how to split a big problem into smaller problems.
Profile Image for Deepak Sandhu.
24 reviews1 follower
February 24, 2018
it is condensed. but too short. it shows how functional programming can be used.
But does not teach a lot how to write functional programs.
if you are new to functional programming (in python) its a good start. but does need more than one read to get it at some topics.

its better to read a little on functional programming in general before starting this.
Profile Image for Takeshi.
5 reviews5 followers
October 27, 2017
A booklet that introduces functional programming style with a non-FP language. The contents are only as long as three or four blog articles but basically cover the most commonly used FP-style implementations in Python.
30 reviews3 followers
December 30, 2017
Provide enough information about functional programming and how does it be applied/affected in our Python code.

Short enough to read in an afternoon, simple enough to get it all in a single read. I would recommend this book for junior Python programmer.
Profile Image for Prashant Phani.
13 reviews
November 7, 2021
Was a very good book, but too short. It is a very good intro to the mindset of functional programming for someone who knows python but is new to the paradigm.
Profile Image for Jin Shusong.
79 reviews2 followers
December 7, 2021
The text is very short. But the author listed the most important skills in functional python coding.
4 reviews
September 4, 2019
This book gives a concise, although not comprehensive, overview of functional programming in Python. The length of the book suggests an introduction but a beginner in either Python or functional programming would have a hard time understanding some of the contents and examples immediately. I did take away a few pieces of knowledge from the book such as the use of the functools library.
Profile Image for Dmytro Chasovskyi.
89 reviews
May 5, 2017
I would rather not recommend this book for people who would like to view on the Python Functional Programming side without previous Functional Python experience.

The Main shortcoming of this book is lack of completely independent examples. Often they either depend on the previous code or cannot be run not being self-contained from the begging (e.g. on page 27, ```lazy = open('06-laziness.md')```) . It seems for me that book is raw and wasn't rigorously reviewed before publishing.
Displaying 1 - 10 of 10 reviews

Can't find what you're looking for?

Get help and learn more about the design.