After reading a few reviews on what was the best book to learn python, I decided to try out Dive Into Python 3. I however came to the realization, after my purchase, that buying(as this book can also be downloaded free) was a mistake. Arriving at my door step early in the morning I hurriedly opened the package to "Dive" into it. Firstly, I noticed that the review that stated the book was an exact replica of the PDF version was not joke. The book is littered with many underlined phrases that, on a computer, would surely skip you to a informative webpage or future chapter. No problem, I skip the introduction and go for the meaty bits. The book teaches python like a biology teacher would teach about a frog's organs. It gave me code that is dissected and then explained. So, as the title suggest, I dived strait into Python by typing the "code" into my computer and observing how it works. However, while compiling the first example program, I ran into some issues. A real stynax and string definition nightmare. Something wasn't right, I had installed all the right programs, versions matched up and my code was identical to the book, but there where still issues. So I go online and check the HTML version. Turns out the book is printed without any underscores...... Pros:Heavy Square-ish Will stop a door or make a good paperweight Cons:NO UNDERSCORES?! Source code is useless Continually have to check online version My recommendation would be to download the PDF version and give Mark Pilgrim a donation.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# Dive Into Python 3 — Reading Guide
## 【One-Line Pitch】
A hands-on, code-dissection approach to Python 3 for programmers who already know another language—learn by reading real, working examples that are pulled apart line-by-line and explained like a biology lesson on frog anatomy. Best for self-taught developers who prefer "show me the code" over abstract theory.
## 【Book Arc】
- **Opening (~0%–9%)**: Installation and setup across platforms, plus a "what's new in Python 3" chapter for veterans of the original Python 2 book. Covers IDLE, alternative editors/IDEs, and the philosophical shift from Python 2 to 3.
- **Early (~9%–25%)**: Core data types—lists, tuples, sets, dictionaries, and None—each demonstrated through interactive shell examples. Introduces the `import` search path, docstrings, and the first real program (`approximate_size()`).
- **Early-to-Middle (~25%–38%)**: Deep dive into strings, bytes, and encodings (UTF-8, CP-1252, GB18030, Big5), followed by a substantial treatment of regular expressions—from basic patterns to verbose mode with commented, readable regex.
- **Middle (~38%–47%)**: Building a pluralization engine as a running case study, progressing from naive if-statements to rule-based abstraction, then to a file-driven iterator with caching. Introduces generators and the `StopIteration` protocol.
- **Late (~47%+)**: Testing and debugging—assertions, unit testing philosophy, and the `itertools` module. The alphametics puzzle solver demonstrates constraint-checking with asserts and grouping with `itertools.groupby()`.
## 【Key Takeaways】
- **Python 3 is a deliberate break from Python 2** (Opening): The book targets readers who know Python 2 and want to migrate—expect emphasis on what changed, not just what's new. If you're a complete beginner, you may need supplementary material.
- **Docstrings are runtime-accessible documentation** (Early): A function's docstring becomes an attribute available at runtime, and IDEs use it for tooltips. Always write them—they're not just comments, they're part of the API.
- **Lists vs. tuples: mutable vs. frozen** (Early): `append()` adds one item (any type), `extend()` adds each element of a list. Tuples are "frozen lists"—convert with `tuple()` and `list()`. A one-item tuple needs a trailing comma: `(False,)` is a tuple, `(False)` is just a bool.
- **Sets are for membership and set math** (Early): `in` tests membership; `union()`, `intersection()`, `difference()`, and `symmetric_difference()` cover set operations. Three of these methods are symmetric—know which ones.
- **Strings vs. bytes is a real distinction** (Early): A string has characters; a bytes object has bytes. The same string encodes to different byte sequences in UTF-8, GB18030, or Big5—and decodes back correctly. This is essential for international text handling.
- **Verbose regex is self-documenting** (Early): With `re.VERBOSE`, whitespace and comments are ignored, letting you write patterns like `M{0,3} # thousands` with inline explanations. Always pass `re.VERBOSE` explicitly—it's easy to forget.
- **Abstraction pays off in rule-based systems** (Middle): The pluralization engine evolves from hardcoded if-statements to a generic rule sequence, then to file-driven rules with caching. Each refactor makes adding new rules easier—a lesson in incremental design.
- **Assertions are runtime guards, not just tests** (Late): `assert` raises `AssertionError` on false conditions, optionally with a message. The alphametics solver uses it to bail early on impossible puzzles (>10 unique letters). Use asserts for invariants, not user-input validation.
## 【Reading Tips】
- **Skim the installation chapters** (~0%–9%) unless you're setting up Python 3 on a new machine. The editor/IDE discussion is dated—PyDev and Komodo are mentioned, but the community list is the real takeaway.
- **Deep-read the regex chapters** (~25%–38%): The progression from compact to verbose patterns is the clearest regex tutorial you'll find. Type every example into IDLE—regex is learned by doing, not reading.
- **Work through the pluralization engine twice** (~38%–47%): First read for the concept (rules → abstraction → file-driven), then re-read for the implementation details (caching, `StopIteration`). This is the book's intellectual core.
- **Watch for the print edition's missing underscores**: The physical book reportedly omits underscores in code, breaking examples. Use the free online HTML version or PDF instead—the content is identical but the code works.
- **Skip the alphametics chapter if pressed for time** (~47%+): It's a fun puzzle, but the assert and `itertools` lessons are covered more concisely elsewhere.
## 【Coverage Limits】
This guide covers the book's progression through data types, strings/encodings, regex, the pluralization case study, and testing. The excerpts do not cover later chapters on files, XML/HTML parsing, HTTP web services, or the comprehensive unit testing framework—those sections are not represented in the source material.
##
Page 1
to Python 3. … If all of that is true, read on. (If none of that is true, you’d be better off starting at the beginning.) Python 3 comes with a script called...
E_Match object at 0106F4A8> 1. This pattern has three parts. ^ matches what follows only at the beginning of the string. If this were not specified, the patt...
_too_large self.assertRaises(roman2.OutOfRangeError, roman2.to_roman, 4000) AssertionError: OutOfRangeError not raised by to_roman ② Ran 2 tests in 0.016s FA...
codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 28: character maps to <unde...
serializes it as an empty element (with the /> shortcut). 4. To set the text content of an element, simply set its .text property. 5. Now the title element i...
nd sure enough, this response contains uncompressed data. 6. This response includes caching headers that state that this feed can be cached for up to 24 hour...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Dive Into Python 3 (Books for Professionals by Professionals) (Mark Pilgrim)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Dive Into Python 3 (Books for Professionals by Professionals) (Mark Pilgrim)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment