官术网_书友最值得收藏!

  • Mastering Python
  • Rick van Hattem
  • 452字
  • 2021-07-16 11:10:30

What this book covers

Chapter 1, Getting Started – One Environment per Project, introduces virtual Python environments using virtualenv or venv to isolate the packages in your Python projects.

Chapter 2, Pythonic Syntax, Common Pitfalls, and Style Guide, explains what Pythonic code is and how to write code that is Pythonic and adheres to the Python philosophy.

Chapter 3, Containers and Collections – Storing Data the Right Way, is where we use the many containers and collections bundled with Python to create code that is fast and readable.

Chapter 4, Functional Programming – Readability Versus Brevity, covers functional programming techniques such as list/dict/set comprehensions and lambda statements that are available in Python. Additionally, it illustrates their similarities with the mathematical principles involved.

Chapter 5, Decorators – Enabling Code Reuse by Decorating, explains not only how to create your own function/class decorators, but also how internal decorators such as property, staticmethod, and classmethod work.

Chapter 6, Generators and Coroutines – Infinity, One Step at a Time, shows how generators and coroutines can be used to lazily evaluate structures of infinite size.

Chapter 7, Async IO – Multithreading without Threads, demonstrates the usage of asynchronous functions using async def and await so that external resources no longer stall your Python processes.

Chapter 8, Metaclasses – Making Classes (Not Instances) Smarter, goes deeper into the creation of classes and how class behavior can be completely modified.

Chapter 9, Documentation – How to Use Sphinx and reStructuredText, shows how you can make Sphinx automatically document your code with very little effort. Additionally, it shows how the Napoleon syntax can be used to document function arguments in a way that is legible both in the code and the documentation.

Chapter 10, Testing and Logging – Preparing for Bugs, explains how code can be tested and how logging can be added to enable easy debugging in case bugs occur at a later time.

Chapter 11, Debugging – Solving the Bugs, demonstrates several methods of hunting down bugs with the use of tracing, logging, and interactive debugging.

Chapter 12, Performance – Tracking and Reducing Your Memory and CPU Usage, shows several methods of measuring and improving CPU and memory usage.

Chapter 13, Multiprocessing – When a Single CPU Core Is Not Enough, illustrates that the multiprocessing library can be used to execute your code, not just on multiple processors but even on multiple machines.

Chapter 14, Extensions in C/C++, System Calls, and C/C++ Libraries, covers the calling of C/C++ functions for both interoperability and performance using Ctypes, CFFI, and native C/C++.

Chapter 15, Packaging – Creating Your Own Libraries or Applications, demonstrates the usage of setuptools and setup.py to build and deploy packages on the Python Package Index (PyPI).

主站蜘蛛池模板: 德江县| 遂宁市| 苍山县| 礼泉县| 丰都县| 卢氏县| 化隆| 白河县| 施秉县| 浮山县| 咸阳市| 永登县| 富平县| 高邑县| 新昌县| 永修县| 筠连县| 县级市| 阳曲县| 依兰县| 尖扎县| 特克斯县| 扶风县| 无极县| 长寿区| 松潘县| 禄丰县| 高清| 金山区| 吉水县| 和田县| 鹿泉市| 南城县| 荆州市| 阳东县| 海晏县| 陇南市| 西藏| 名山县| 渝中区| 南陵县|