Best Sellers Rank: #529,517 in Books (See Top 100 in Books) #29 in Functional Software Programming #205 in Object-Oriented Design #555 in Python Programming
Customer Reviews: 3.9 out of 5 stars 31Reviews
Product Information
From the Publisher
What is functional programming and why is it useful?
Key Features:
For Python programmers new to functional programming, or with some exposure in another language
Coverage of essential functional Python libraries as well as add-ons
A comprehensive set of exercises at the end of every chapter that build on chapter content
Functional programming rests on a few foundational concepts, centered on using function definitions in various combinations to implement the processing you need. A key element of using functions is a preference for using stateless objects like Python strings, numbers, and tuples.
For data analytics and machine learning applications, the functional style often fits well with data cleansing and transformation pipelines.
The functional approach is distinct from object-oriented (OO) programming:
It tends to avoid object creation
This can significantly reduce memory use and improve performance, when compared with OO techniques
Since Python is not a purely functional language, some OO techniques will be part of the implementations. This means we can make use of the best aspects of both paradigms.
What’s new in this edition of the book?
We’ve covered a few new packages, toolz and pyrsistent, that are often helpful for writing functional programs.
We’ve expanded the coverage of immutable data structures to include NamedTuple and frozen @dataclass classes. This includes using the pyrsistent module for immutable objects that can evolve by emitting an object of the same class in a revised state.
You’ll also find examples of the new match statement, which has type-matching features often used in other functional languages. All type hints have been revised to match Python 3.10 definitions, following PEP-585. Finally, a complete set of exercises have been added to each chapter.
All of the example code is unit tested, and provided in the GitHub repository for the book. This process works by examining all of the code and console examples in the book’s source and placing the code into a context where it’s testable. There are about 250 test cases for the examples.
Table of Contents:
Working with Collections
Higher-Order Functions
Recursions and Reductions
The Itertools Module
The Functools Module
The Multiprocessing, Threading, and Concurrent.Futures Modules