Dive Into Python 3
Погружение в Python 3 для опытных разработчиков
Summary:
Introduction
Mark Pilgrim's book "Dive Into Python 3" (2009, 360 pages) holds a special place in Python language literature. It is not another introduction for beginners, but a practical guide for those already familiar with programming basics who want to quickly master Python 3, transitioning from Python 2 or another language. The author sets an ambitious goal: not just to teach syntax, but to show how to think in Python 3, using its unique features — iterators, generators, decorators, context managers. The book is written in a lively, energetic style, with real-world examples: from web page parsing to working with XML and writing unit tests.
What the book is about
"Dive Into Python 3" consists of 14 chapters, each dedicated to a specific task or aspect of the language. Main topics:
- Porting code from Python 2 to Python 3 — one of the key chapters, still relevant today for legacy projects.
- Strings and Unicode — deep dive into working with text, encodings, and bytes.
- Regular expressions — practical examples of parsing phone numbers, addresses, and URLs.
- Generators and iterators — from simple list comprehensions to yield from.
- Decorators — creating custom decorators for logging, caching, and argument validation.
- Web scraping — parsing HTML using urllib and BeautifulSoup.