Functional programming in Python ebook

Martin McBride, 2019-08-08
Tags immutable, recursion, closure, iterator, reduce, comprehension, partial application, currying, functor, monad, itertools, functools
Categories book, functional programming

Buy now from Leanpub or Amazon.

Download a free preview.

Python's best kept secret is its built in support for functional programming. Even better, it allows functional programming to be blended seamlessly with procedural and object oriented coding styles. This book explains what functional programming is, how Python supports it, and how you can use it to write clean, efficient and reliable code.

The book covers the basics of functional programming including function objects, immutability, recursion, iterables, comprehensions and generators. It also covers more advanced topics such as closures, memoization, partial functions, currying, functors and monads. No prior knowledge of functional programming is required, just a working knowledge of Python.


  • What is functional programming?
  • Objects, variables, and functions as objects.
  • Immutable objects.
  • Recursion.
  • Closures.
  • Iterators.
  • Transforming and reducing iterables.
  • Comprehensions.
  • Generators.
  • Partial application and currying.
  • Functors and monads.
  • itertools, functools and other useful libraries.

Buy now from Leanpub, or download a free preview.

Tag cloud

2d arrays abstract data type alignment and array arrays bezier curve built-in function close closure colour comparison operator comprehension context conversion data types design pattern device space dictionary duck typing efficiency encryption enumerate filter font font style for loop function function composition function plot functools generator gif gradient greyscale higher order function html image processing imagesurface immutable object index inner function input installing iter iterator itertools lambda function len linspace list list comprehension logical operator lru_cache mandelbrot map monad mutability named parameter numeric python numpy object open operator optional parameter or partial application path positional parameter print pure function radial gradient range recipes recursion reduce rgb rotation scaling sequence slice slicing sound spirograph str stream string subpath symmetric encryption template text text metrics transform translation transparency tuple unpacking user space vectorisation webserver website while loop zip

Copyright (c) Axlesoft Ltd 2020