도서 정보
도서 상세설명
1: Getting Started – One Environment per Project
Creating a virtual Python environment using venv
Bootstrapping pip using ensurepip
Installing C/C++ packages
Summary
2: Pythonic Syntax, Common Pitfalls, and Style Guide
Code style – or what is Pythonic code?
Common pitfalls
Summary
3: Containers and Collections – Storing Data the Right Way
Time complexity – the big O notation
Core collections
Advanced collections
Summary
4: Functional Programming – Readability Versus Brevity
Functional programming
list comprehensions
dict comprehensions
set comprehensions
lambda functions
functools
itertools
Summary
5: Decorators – Enabling Code Reuse by Decorating
Decorating functions
Decorating class functions
Decorating classes
Useful decorators
Summary
6: Generators and Coroutines – Infinity, One Step at a Time
What are generators?
Coroutines
Summary
7: Async IO – Multithreading without Threads
Introducing the asyncio library
Summary
8: Metaclasses – Making Classes (Not Instances) Smarter
Dynamically creating classes
Abstract classes using collections.abc
Automatically registering a plugin system
Order of operations when instantiating classes
Storing class attributes in definition order
Summary
9: Documentation – How to Use Sphinx and reStructuredText
The reStructuredText syntax
The Sphinx documentation generator
Documenting code
Summary
10: Testing and Logging – Preparing for Bugs
Using examples as tests with doctest
Testing with py.test
Mock objects
Logging
Summary
11: Debugging – Solving the Bugs
Non-interactive debugging
Interactive debugging
Summary
12: Performance – Tracking and Reducing Your Memory and CPU Usage
What is performance?
Timeit – comparing code snippet performance
cProfile – finding the slowest components
Line profiler
Improving performance
Memory usage
Performance monitoring
Summary
13: Multiprocessing – When a Single CPU Core Is Not Enough
Multithreading versus multiprocessing
Hyper-threading versus physical CPU cores
Creating a pool of workers
Sharing data between processes
Remote processes
Summary
14: Extensions in C/C++, System Calls, and C/C++ Libraries
Introduction
Calling C/C++ with ctypes
CFFI
Native C/C++ extensions
Summary
15: Packaging – Creating Your Own Libraries or Applications
Installing packages
Setup parameters
Packages
Entry points
Package data
Testing packages
C/C++ extensions
Wheels – the new eggs
Summary
backindex: Appendix A: Index