Chapter 2. Introducing Some Functional Features

Most of the features of functional programming are already first-class parts of Python. Our goal in writing functional Python is to shift our focus away from imperative (procedural or object-oriented) techniques to the maximum extent possible.

We'll look at each of the following functional programming topics:

  • First-class and higher-order functions, which are also known as pure functions.
  • Immutable Data.
  • Strict and non-strict evaluation. We can also call this eager vs. lazy evaluation.
  • Recursion instead of an explicit loop state.
  • Functional type systems.

This should reiterate some concepts from the first chapter. Firstly, that purely functional programming avoids the complexities of explicit state maintained ...

Get Functional Python Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.