- Functional Python Programming
- Steven F. Lott
- 166字
- 2021-08-27 19:20:26
Summary
In this chapter, we looked closely at writing pure functions free of side effects. The bar is low here, since Python forces us to use the global statement to write impure functions. We looked at generator functions and how we can use these as the backbone of functional programming. We also examined the built-in collection classes to show how they're used in the functional paradigm. While the general idea behind functional programming is to limit the use of stateful variables, the collection objects are generally stateful and, for many algorithms, also essential. Our goal is to be judicious in our use of Python's non-functional features.
In the next two chapters, we'll look at higher-order functions: functions that accept functions as arguments as well as returning functions. We'll start with an exploration of the built-in higher-order functions. In later chapters, we'll look at techniques for defining our own higher-order functions. We'll also look at the itertools and functools modules and their higher-order functions in later chapters.
- Spring 5.0 Microservices(Second Edition)
- Java范例大全
- ThinkPHP 5實戰(zhàn)
- Mastering OpenCV 4
- Unity Game Development Scripting
- Spring Boot企業(yè)級項目開發(fā)實戰(zhàn)
- Getting Started with Gulp
- 青少年學(xué)Python(第1冊)
- 軟件測試綜合技術(shù)
- Getting Started with Python
- Scratch從入門到精通
- Python機器學(xué)習(xí)開發(fā)實戰(zhàn)
- 3D Printing Designs:The Sun Puzzle
- Bitcoin Essentials
- Microsoft XNA 4.0 Game Development Cookbook