Secrets of the Python Essential Reference
By David Beazley, May 7, 2005
Everyone knows that reference books are supposed to be terse, dry, and
humorless. I suppose the Python Essential Reference is no exception
to that rule, but that's not to say I didn't try to sneak a few things
under the radar. With that in mind, I thought I'd spill some of these
secrets---mostly in the interest of giving other authors some bad ideas ;-).
Most of these secrets apply to the 2nd Edition of the Python Essential Reference.
- Pg. 266. In the section that describes the mimetools module, a
sample email message is shown. As it turns out, the sample email
(including subject line, message body, and attachment) is modeled
after the famous Melissa Macro
Virus, that was probably the most widespread Internet virus in
1999. On top of that, the base64 encoded message is actually a rather
violent short story that reads as follows when decoded:
It was a long hot day in the month of July, when Larry started talking
about socio-political scalable immersive virtual temporal
collaborative parallel high performance web-based mobile
object-oriented scientific computing environments. Fortunately, Pete
had remembered to bring his .45...
-
Pg. 274. The email message listed as an example for the RFC822 module is based on typical
emails sent from a clueless postdoc in the CS department to the technical staff. As it turns out, this
postdoc spent most of his time complaining about issues that were either total nonsense or impossible
to resolve. For instance, at one point someone overheard him screaming into his phone at someone over at Apple computer
about why he couldn't buy a Macintosh with a traditional RS-232 serial port on it ("Damn it! I'm the customer and I'm supposed
to get things my way.").
-
There are numerous references to various URLs and IP addresses. On
p. 266, there is a reference to www.swig.org, my own software project.
On p. 225, there is a reference to www.petaflop.org, a domain I own.
Also, there is a reference to www.pud.com, a website owned by the
infamous founder of www.fuckedcompany.com (obscure fact: I had one of the highest scores in the dotcom deadpool
at the time). In the first edition, there is a reference to www.jarjarmustdie.com (on p. 181), a website that
sprung up shortly after the release of the new Star Wars movie.
-
Pg. 249. In the example for robotparser, access is forbidden in a
directory called "/warheads/designs." This is a somewhat obscure reference
to security problems at Los Alamos (my former employer). As far as I know,
there has never been a website devoted to this topic.
-
Pg. 252. The IP address 132.151.1.90 was in no way related to www.python.org ;-).
- Pg. 5, The string "What is footnote 5?" refers to a comment on a paper review---apparently this
is the only useful comment the reviewer could come up with.
- Pg. 8. The usename "pxl" refers to Peter Lomdahl, my mentor at Los Alamos.
- Pg. 49. There is a reference to Douglas Adams who died at the age of 49 (hence the page number).
- The numbers 42 and 37 appear with some regularity in examples. 42 is an obvious reference to The Hitchhikers Guide to the Galaxy. 37 is a reference to the movie "Clerks." For example, see pg. 73.
- Pg. 87 has a letter to "Mr. Bush" asking him to return a blender.
This is a tasteless, but obscure reference to President Bush's
past drinking problems (obviously a blender would be useful in whipping up some potent
margaritas or something).
- The index entry for "C++" refers to page 666. Enough said.
- On p. 41, the "authors speedy PC" is described as a 200 Mhz PC.
At the time, this was a very slow and outdated machine. However, this
was actually the machine I used to write the book.
Here are some obscure facts about the production of the book.
- I never intended to write a Python book. I was actually
approached by New Riders due to my involvement with
Python conferences at the time.
- When I met the acquisitions editor to talk about the book, I brought a copy
of the Kernighan and Ritchie "C Programming Language" book with me and used it
as example---both of the physical size and writing style.
- During the production of the first edition, I went to the emergency room and was diagnosed with a possible ulcer.
(Apparently this is not uncommon for first-time authors as I learned later on).
- I generated the index for the 2nd edition myself. It was created by looking at final proofs and entering data into
a Python script that I wrote. The script collected information and automatically generated index pages. All of this was done a couple
of days before the book went to press.
- I wrote the entire book in plain-text ASCII. It was formatted
into final form by the wonderful editor Robin Drake.
- Large portions of the book were written over the summer while I sat in a cubical at CNRI hanging out with
Guido and number of other well-known Python hackers.
- The cover of the first edition features a photograph of the Mayan
pyramid at Chichen Itza and a colophon written by Ivan Van Laningham.
As it turns out, Ivan had given a very well received talk about Mayan
calendar calculations at the Python conference. On top of that, I had
previously visited the same pyramid while attending an IEEE conference
several years earlier. It seemed like a good match. The 2nd edition
features a picture from Chaco Canyon in New Mexico----a place where I
spent an enjoyable camping trip when I worked at Los Alamos.
- When the 2nd edition came out, I was asked about marketing quotes that could be
put on the inside cover. I wanted to use an Amazon.com review of the first edition that started out as
"Every so often, a book comes along that makes you ask yourself 'gee, whem was the last time I had my
eyes checked?' This is just such a book." New Riders rejected this idea.