Functional Python Programming - Third Edition: Use a functional approach to write succinct, expressive, and efficient Python code
暫譯: 功能性 Python 程式設計 - 第三版:使用函數式方法撰寫簡潔、表達力強且高效的 Python 代碼

Lott, Steven F.

  • 出版商: Packt Publishing
  • 出版日期: 2022-12-30
  • 售價: $1,650
  • 貴賓價: 9.5$1,568
  • 語言: 英文
  • 頁數: 576
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1803232579
  • ISBN-13: 9781803232577
  • 相關分類: Python程式語言
  • 立即出貨 (庫存=1)

相關主題

商品描述

Python isn't all about object-oriented programming. Discover a valuable way of thinking about code design through a function-first approach - and learn when you need to use it. Now with detailed exercises at the end of every chapter!

Purchase of the print or Kindle book includes a free eBook in PDF format.

Key Features

- Learn how, when, and why to adopt functional elements in your projects
- Explore the Python modules essential to functional programming, like itertools and functools
- Revised to cover new features of Python 3.10, exercises at the end of every chapter, and more

Book Description

Not enough developers understand the benefits of functional programming, or even what it is. Author Steven Lott demystifies the approach, teaching you how to improve the way you code in Python and make gains in memory use and performance.

Starting from the fundamentals, this book shows you how to apply functional thinking and techniques in a range of scenarios, with examples centered around data cleaning and exploratory data analysis. You'll learn how to use generator expressions, list comprehensions, and decorators to your advantage. You don't have to abandon object-oriented design completely, though - you'll also see how Python's native object-orientation is used in conjunction with functional programming techniques.

By the end of this book, you'll be well versed in the essential functional programming features of Python, and understand why and when functional thinking helps. You'll also have all the tools you need to pursue any additional functional topics that are not part of the Python language.

What you will learn

- Use Python's libraries to avoid the complexities of state-changing classes
- Leverage built-in higher-order functions to avoid rewriting common algorithms
- Write generator functions to create lazy processing
- Design and implement decorators for functional composition
- Make use of Python type annotations to describe parameters and results of functions
- Apply functional programming to concurrency and web services
- Explore the PyMonad library for stateful simulations

Who this book is for

The functional paradigm is very useful for programmers working in data science, but any Python developer who wants to create more reliable, succinct, and expressive code will have much to learn from this book.

No prior knowledge of functional programming is required to get started, though Python programming knowledge is assumed. A running Python environment is essential.

商品描述(中文翻譯)

Python 不僅僅是物件導向程式設計。透過以函數為主的方式,發現一種有價值的程式碼設計思維,並學習何時需要使用它。現在每章末尾都有詳細的練習題!

購買印刷版或 Kindle 書籍包括免費的 PDF 格式電子書。

主要特色

- 學習如何、何時以及為什麼在專案中採用函數式元素
- 探索對函數式程式設計至關重要的 Python 模組,如 itertools 和 functools
- 修訂以涵蓋 Python 3.10 的新功能,每章末尾都有練習題,還有更多內容

書籍描述

並不是所有的開發者都了解函數式程式設計的好處,甚至不知道它是什麼。作者 Steven Lott 解釋了這種方法,教你如何改善在 Python 中的程式碼編寫方式,並在記憶體使用和性能上獲得提升。

從基礎開始,本書展示了如何在各種情境中應用函數式思維和技術,範例圍繞數據清理和探索性數據分析。你將學會如何利用生成器表達式、列表推導式和裝飾器來獲益。然而,你不必完全放棄物件導向設計——你還會看到 Python 的原生物件導向如何與函數式程式設計技術結合使用。

在本書結束時,你將熟悉 Python 的基本函數式程式設計特性,並理解為什麼以及何時函數式思維有助於程式設計。你還將擁有追求任何不屬於 Python 語言的額外函數式主題所需的所有工具。

你將學到的內容

- 使用 Python 的庫來避免狀態變更類別的複雜性
- 利用內建的高階函數來避免重寫常見演算法
- 編寫生成器函數以創建延遲處理
- 設計和實現用於函數組合的裝飾器
- 利用 Python 類型註解來描述函數的參數和結果
- 將函數式程式設計應用於並發和網路服務
- 探索 PyMonad 庫以進行有狀態的模擬

本書適合誰

函數式範式對於從事數據科學的程式設計師非常有用,但任何希望創建更可靠、簡潔和表達力強的程式碼的 Python 開發者都能從本書中學到很多。

開始時不需要具備函數式程式設計的先前知識,但假設你具備 Python 程式設計的知識。運行中的 Python 環境是必需的。

目錄大綱

1. Understanding Functional Programming
2. Introducing Essential Functional Concepts
3. Functions, Iterators, and Generators
4. Working with Collections
5. Higher-Order Functions
6. Recursions and Reductions
7. Complex Stateless Objects
8. The Itertools Module
9. Itertools for Combinatorics - Permutations and Combinations
10. The Functools Module
11. The Toolz Package
12. Decorator Design Techniques
13. The PyMonad Library
14. The Multiprocessing, Threading, and Concurrent.Futures Modules
15. A Functional Approach toWeb Services
16. A Chi-Squared Case Study

目錄大綱(中文翻譯)

1. Understanding Functional Programming

2. Introducing Essential Functional Concepts

3. Functions, Iterators, and Generators

4. Working with Collections

5. Higher-Order Functions

6. Recursions and Reductions

7. Complex Stateless Objects

8. The Itertools Module

9. Itertools for Combinatorics - Permutations and Combinations

10. The Functools Module

11. The Toolz Package

12. Decorator Design Techniques

13. The PyMonad Library

14. The Multiprocessing, Threading, and Concurrent.Futures Modules

15. A Functional Approach toWeb Services

16. A Chi-Squared Case Study