Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Table of Contents
Mastering Python
Mastering Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
1. Getting Started – One Environment per Project
Bootstrapping pip using ensurepip
Installing C/C++ packages
Summary
2. Pythonic Syntax, Common Pitfalls, and Style Guide
Common pitfalls
Summary
3. Containers and Collections – Storing Data the Right Way
Core collections
Advanced collections
Summary
4. Functional Programming – Readability Versus Brevity
list comprehensions
dict comprehensions
set comprehensions
lambda functions
functools
itertools
Summary
5. Decorators – Enabling Code Reuse by Decorating
Decorating class functions
Decorating classes
Useful decorators
Summary
6. Generators and Coroutines – Infinity, One Step at a Time
Coroutines
Summary
7. Async IO – Multithreading without Threads
Summary
8. Metaclasses – Making Classes (Not Instances) Smarter
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 Sphinx documentation generator
Documenting code
Summary
10. Testing and Logging – Preparing for Bugs
Testing with py.test
Mock objects
Logging
Summary
11. Debugging – Solving the Bugs
Interactive debugging
Summary
12. Performance – Tracking and Reducing Your Memory and CPU Usage
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
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
Calling C/C++ with ctypes
CFFI
Native C/C++ extensions
Summary
15. Packaging – Creating Your Own Libraries or Applications
Setup parameters
Packages
Entry points
Package data
Testing packages
C/C++ extensions
Wheels – the new eggs
Summary
Index
← Prev
Back
Next →
← Prev
Back
Next →