Internals of Python 3.x
US$ 19.95
The publisher has enabled DRM protection, which means that you need to use the BookFusion iOS, Android or Web app to read this eBook. This eBook cannot be used outside of the BookFusion platform.
Description
Contents
Reviews
Language
English
ISBN
9789391030940
Cover Page
Title Page
Copyright Page
Dedication Page
About the Author
About the Reviewer
Acknowledgement
Preface
Errata
Table of Contents
1. Design of Generic Objects
Structure
Objective
The PyObject
Understanding _PyObject_HEAD_EXTRA
Reference counting
The PyVarObject
The PyTypeObject
Generic type function prototypes
Specific type function prototypes
The type object substructures
The PyNumberMethods substructure
The PySequenceMethods substructure
The PyMappingMethods substructure
The type object
Name and sizes of type
Allocator, deallocator, and initialization functions
Iterator functions
Methods and attributes
Printing an instance of the type
Conclusion
2. Basic Python Types
Structure
Objectives
The Bool object
The Bool type
Creating a Boolean object
Representation of Boolean objects
Operations on Boolean objects
The Long object
The type of the Long object
Creating a new long object
Arithmetic operations
Bitwise operations
The Float object
The type object
Creating a new float object
Arithmetic operations
Comparison operations
The None object
The none type
Creation of the none object
Operations on the none object
Representation of the none object
Conclusion
3. Iterable Sequence Objects
Structure
Objective
The list object
The list type
Creating a list
Accessing an element in a list
Assigning an element in a list
Fetching the length of a list
Removing an element from the list
Freeing all the elements in the list
Checking an element in a list
List iteration
Fetching the iterator
Iterating the elements in the list
The tuple object
The tuple type
Creation of the tuple object
Hashing of the tuple object
Unpacking the elements in a tuple object
Conclusion
Reader exercises
4. Set and Dictionary
Structure
Objective
The set object
Structure of the set object
Creation of the set object
Adding an element to a set object
Iterating a set
Finding an element in a set
Union and intersection of sets
Dictionaries
Structure of a dictionary
Creating and inserting to dictionaries
Iterating dictionaries
Conclusion
5. Functions and Generators
Structure
Objective
Creation of the PyFunctionObject
The LOAD_CONST opcode
The MAKE_FUNCTION opcode
Function call
Structure of a function frame
CALL_FUNCTION opcode
Generators
Creating a generator
Creating an instance of a generator object
Structure of the generator object
Execution of a generator
Execution of the generator code
Conclusion
6. Memory Management
Structure
Objective
Memory management overview
Arenas
Arena memory management
Arena memory allocation
Arena memory deallocation
Memory pools
Structure of a memory pool
Memory allocation for objects
Pool table
Allocation lesser than SMALL_REQUEST_THRESHOLD
Conclusion
Reader exercises
7. Interpreter and Opcodes
Structure
Objectives
Opcodes
Python interpreter stack opcodes
Interpreter stack
Stack operation opcodes
Numerical operation opcodes
Matrix operation opcodes
Iterable opcodes
Looping opcodes
Branching opcodes
Implementation of the interpreter
Opcode prediction
Opcode dispatching and the GIL
Dispatch using computed go-tos
Dispatch without computed go-tos
Signal handling
Initializing signal handlers
Listening to signals
Signals and the interpreter
Conclusion
8. GIL and Multithreading
Structure
Objective
The GIL
Structure of GIL
Creating and initializing the GIL
Taking the GIL to access the interpreter
Relinquishing the GIL
Deallocating the GIL
Multithreading with the GIL
Conclusion
9. Async Python
Example
Structure
Objective
Coroutines
Continuing the execution of the coroutine
Asynchronous functions
Conclusion
10. Source Code Layout and the Compiler Stages
Structure
Objective
The folder structure of the Python source code
The main function
The Python grammar
Parse tree to abstract syntax tree
Operations on the parse tree
Navigation and conversion of the parse tree
Symbol table generation
Compilation to opcode
Conclusion
Index
The book hasn't received reviews yet.