← 输入框|leanpub.com|刷新

Leanpub Header

Skip to main content

Inside The Python Virtual Machine

Inside The Python Virtual Machine
本书目前的完成进度为 100%上次更新时间:2024-07-24

You know how to program in Python but are interested in what goes on under the covers of the interpreter? Well, fasten your seat-belts as this book will take you on a tour of  the virtual machine that runs your Python code.

It will describe how Python code is compiled and run, how the language itself can be modified and will demystify the mysterious bytecodes that run on the Python virtual machine.

会员免费

有会员资格

免费!

$24.99

支付金额

作者利润

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
4,577
读者
125
页数
34,266字数
关于

关于

关于本书

Inside the Python Virtual Machine provides a guided tour under the covers of the Python interpreter for the curious pythonista. It attempts to show the user what happens from the moment the user executes a piece of Python code to the point when the interpreter returns the result of executing the piece of code.

This book will provide the readers with an understanding of the various processes that go into compiling and executing a python program removing most of the mystery surrounding how the python interpreter executes source code. The books starts out with a description of the compilation phase with emphasis on the less generic parts of the compilation phase. It then proceeds to discuss python objects and their implementation in CPython. This is followed by a discussion of various objects types that are central to the interpreter such as frame objects and code objects. The process of evaluating code objects by the interpreter loop is also discussed as well as how to extend the Python programming language with your own constructs.

分享此书

分类

作者

关于作者们

Obi Ike-Nwosu

Obi has more than five years of experience using Python. His interests include but are not limited to algorithms, mathematics, computer security, writing, developmental economics, business and problem solving in general.

目录

目录

1.Introduction

2.The View From 30,000ft

3.Compiling Python Source Code

  1. 3.1From Source To Parse Tree
  2. 3.2Python tokens
  3. 3.3From Parse Tree To Abstract Syntax Tree
  4. 3.4Building The Symbol Table
  5. 3.5From AST To Code Objects
  6. Graph Traversal

4.Python Objects

  1. 4.1PyObject
  2. 4.2Dissecting Types
  3. 4.3Type Object Case Studies
  4. 4.4Minting type instances
  5. 4.5Objects and their attributes
  6. 4.6Method Resolution Order (MRO)

5.Code Objects

  1. 5.1Exploring code objects
  2. 5.2Code Objects within other code objects
  3. 5.3Code Objects in the VM

6.Frame Objects

  1. 6.1Allocating Frame Objects

7.Interpreter and Thread States

  1. 7.1The Interpreter state
  2. 7.2The Thread state

8.Intermezzo: The abstract.c Module

9.The evaluation loop, ceval.c

  1. 9.1Putting names in place
  2. 9.2The parts of the machine
  3. 9.3The Evaluation loop
  4. 9.4A sampling of opcodes

10.The Block Stack

  1. 10.1A Short Note on Exception Handling

11.From Class code to bytecode

12.Generators: Behind the scenes.

  1. 12.1The Generator object
  2. 12.2Running a generator

作者的其他著作

作者的其他著作

Leanpub 无条件、零风险的100%满意保证

在支付后的60天内,只需简单点击两下,您便可以退书并且取回先前支付的全部金额。
查看完整条款。

在10美元的购买中赚取8美元,在20美元的购买中赚取16美元

我们在7.99美元或以上的购买中支付80%的版税,在0.99美元到7.98美元之间的购买中支付80%的版税减去0.5美元固定费用。在10美元的销售中您可赚取8美元,在20美元的销售中可赚取16美元。因此,如果我们以20美元的价格售出5000本未退款的图书,您将赚取80,000美元。

(是的,一些作者在Leanpub上已经赚取了远超过这个数额的收入。)

了解更多关于在Leanpub上写作的信息

免费更新。无DRM。

如果你购买了Leanpub的书,只要作者更新这本书,你就可以免费获得更新!许多作者使用Leanpub在他们编写书籍的过程中发布他们的作品。所有读者都可以获得免费更新,无论他们何时购买的书或他们支付了多少钱(包括免费)。

大多数Leanpub书籍都提供PDF(适用于计算机)、EPUB(适用于手机和平板电脑)和MOBI(适用于Kindle)格式。书籍包含的格式会显示在此页面的右上角。

最后,Leanpub的书籍没有任何DRM版权保护的限制,所以你可以轻松地在任何支持的设备上阅读它们。

了解更多关于Leanpub的电子书格式以及在哪里阅读它们

在 Leanpub 上写作和出版

作者与出版社使用 Leanpub 来出版正在写作中和已完成的书籍,就像这本书一样。你也可以使用 Leanpub 来撰写、出版和销售你的作品!Leanpub 是功能强大的平台,非常适合认真的作者。它结合了简单、优雅的写作与出版流程,以及一个可销售正在写作中的电子书的线上商店。Leanpub 是作家的神奇之笔:只需编写纯文本,然后点击按钮即可出版你的电子书。真的就是这么简单。

学习更多关于在 Leanpub 上写作的信息