Internals of Python 3.X: Derive Maximum Code Performance and Delve Further Into Iterations, Objects, Gil, Memory Management, and Various Internals
暫譯: Python 3.X 內部原理:提升代碼性能,深入探討迭代、物件、全域直譯器鎖、記憶體管理及各種內部機制

Raghu, Prashanth

  • 出版商: BPB Publications
  • 出版日期: 2022-01-07
  • 售價: $1,690
  • 貴賓價: 9.5$1,605
  • 語言: 英文
  • 頁數: 236
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 9391030947
  • ISBN-13: 9789391030940
  • 相關分類: Python
  • 海外代購書籍(需單獨結帳)

商品描述

Internals of Python 3.x transform a programmer's learning path by emphasizing the source code over the syntax to teach things from the ground up in nearly the same amount of time and effort.


The book delves into the structure and distinctions between the primary Python object and iterable objects. The iterable types, namely, lists and tuples, have been thoroughly defined in the structure and operations. The internals of sets and dictionaries, which are data structures that provide O(1) insertion and search, have been thoroughly discussed. Memory allocation explains how Python handles memory for tiny and large objects. The chapter on GIL explains how the GIL works, which is halted by a semaphore and a conditional variable. The chapter on Async Python describes how the async module generates coroutines and async functions that can be executed on an event loop and interact through events.


After reading this book, you will be more confident to create high-performance code on a day-to-day basis.


TABLE OF CONTENTS

1. Design of Generic Objects

2. Basic Python Types

3. Iterable Sequence Objects

4. Set and Dictionary

5. Functions and Generators

6. Memory Management

7. Interpreter and Opcodes

8. GIL and Multithreading

9. Async Python

10. Source Code Layout and the Compiler Stages



商品描述(中文翻譯)

Python 3.x 的內部結構改變了程式設計師的學習路徑,強調源代碼而非語法,以幾乎相同的時間和精力從基礎教學。


本書深入探討了主要 Python 物件與可迭代物件之間的結構和區別。可迭代類型,即列表(lists)和元組(tuples),在結構和操作上已被徹底定義。集合(sets)和字典(dictionaries)的內部結構也被詳細討論,這些數據結構提供 O(1) 的插入和查詢。記憶體分配解釋了 Python 如何處理小型和大型物件的記憶體。關於全域解釋鎖(GIL)的章節解釋了 GIL 的運作方式,該鎖由信號量(semaphore)和條件變數(conditional variable)來控制。關於非同步 Python(Async Python)的章節描述了 async 模組如何生成協程(coroutines)和可以在事件循環(event loop)上執行的 async 函數,並通過事件進行互動。


閱讀完本書後,您將更有信心在日常工作中創建高效能的代碼。


目錄

1. 通用物件的設計

2. 基本 Python 類型

3. 可迭代序列物件

4. 集合與字典

5. 函數與生成器

6. 記憶體管理

7. 解釋器與操作碼

8. GIL 與多執行緒

9. 非同步 Python

10. 源代碼佈局與編譯階段