From 2e60267c0466504a0e00dd06ba0d80348128433b Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Mon, 11 Jan 2010 21:43:31 -0500 Subject: [PATCH] 2010! --- about.html | 2 +- advanced-iterators.html | 4 ++-- case-study-porting-chardet-to-python-3.html | 2 +- colophon.html | 2 +- comprehensions.html | 2 +- files.html | 2 +- generators.html | 2 +- http-web-services.html | 2 +- index.html | 2 +- installing-python.html | 2 +- iterators.html | 2 +- native-datatypes.html | 2 +- packaging.html | 2 +- porting-code-to-python-3-with-2to3.html | 2 +- refactoring.html | 2 +- regular-expressions.html | 4 ++-- serializing.html | 2 +- special-method-names.html | 2 +- strings.html | 2 +- table-of-contents.html | 2 +- unit-testing.html | 2 +- whats-new.html | 2 +- where-to-go-from-here.html | 2 +- xml.html | 2 +- your-first-python-program.html | 2 +- 25 files changed, 27 insertions(+), 27 deletions(-) diff --git a/about.html b/about.html index 88fe0ed..49364a1 100755 --- a/about.html +++ b/about.html @@ -23,5 +23,5 @@ abbr{font-variant:none;text-transform:none;letter-spacing:0}

Corrections and feedback to mark@diveintomark.org -

© 2001–9 Mark Pilgrim +

© 2001–10 Mark Pilgrim diff --git a/advanced-iterators.html b/advanced-iterators.html index 432c6ff..483b98f 100755 --- a/advanced-iterators.html +++ b/advanced-iterators.html @@ -36,7 +36,7 @@ S = 6 T = 2 E = 4 -

Puzzles like this are called cryptarithms or alphametics. The letters spell out actual words, but if you replace each letter with a digit from 0–9, it also “spells” an arithmetic equation. The trick is to figure out which letter maps to each digit. All the occurrences of each letter must map to the same digit, no digit can be repeated, and no “word” can start with the digit 0. +

Puzzles like this are called cryptarithms or alphametics. The letters spell out actual words, but if you replace each letter with a digit from 0–10, it also “spells” an arithmetic equation. The trick is to figure out which letter maps to each digit. All the occurrences of each letter must map to the same digit, no digit can be repeated, and no “word” can start with the digit 0.

@@ -643,7 +643,7 @@ NameError: name '__import__' is not defined

-

© 2001–9 Mark Pilgrim +

© 2001–10 Mark Pilgrim diff --git a/case-study-porting-chardet-to-python-3.html b/case-study-porting-chardet-to-python-3.html index 415e770..21d53e2 100755 --- a/case-study-porting-chardet-to-python-3.html +++ b/case-study-porting-chardet-to-python-3.html @@ -749,7 +749,7 @@ tests\EUC-JP\arclamp.jp.xml EUC-JP with confide

-

© 2001–9 Mark Pilgrim +

© 2001–10 Mark Pilgrim diff --git a/colophon.html b/colophon.html index 718809d..0784e32 100644 --- a/colophon.html +++ b/colophon.html @@ -81,7 +81,7 @@ h1:before,h2:before{content:''}

  • OptiPNG -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/comprehensions.html b/comprehensions.html index d52bbc1..7fb2071 100644 --- a/comprehensions.html +++ b/comprehensions.html @@ -376,7 +376,7 @@ TypeError: unhashable type: 'list'

  • Looping techniques

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/files.html b/files.html index f0dffeb..474a5f2 100644 --- a/files.html +++ b/files.html @@ -601,7 +601,7 @@ print('C')

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/generators.html b/generators.html index 59cf896..fdaa3da 100755 --- a/generators.html +++ b/generators.html @@ -412,7 +412,7 @@ def plural(noun, rules_filename='plural5-rules.txt'):

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/http-web-services.html b/http-web-services.html index 18a0a7e..a72fda5 100755 --- a/http-web-services.html +++ b/http-web-services.html @@ -997,7 +997,7 @@ user-agent: Python-httplib2/$Rev: 259 $

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/index.html b/index.html index a9cf814..a6cafda 100644 --- a/index.html +++ b/index.html @@ -57,6 +57,6 @@ h1:before,h2:before{content:''}

    This site is optimized for Lynx just because fuck you.
    I’m told it also looks good in graphical browsers. -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim

    Translations: en español, in italiano, на русском языке diff --git a/installing-python.html b/installing-python.html index 5440f5b..113e92a 100755 --- a/installing-python.html +++ b/installing-python.html @@ -360,7 +360,7 @@ has the same effect as typing a particular string at the help> prompt.

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/iterators.html b/iterators.html index 0c89a57..ca1a532 100755 --- a/iterators.html +++ b/iterators.html @@ -388,7 +388,7 @@ rules = LazyRules()

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/native-datatypes.html b/native-datatypes.html index 8a82022..e008044 100755 --- a/native-datatypes.html +++ b/native-datatypes.html @@ -955,7 +955,7 @@ KeyError: 'db.diveintopython3.org'

  • PEP 238: Changing the Division Operator

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/packaging.html b/packaging.html index 9655dff..43edd2c 100644 --- a/packaging.html +++ b/packaging.html @@ -573,7 +573,7 @@ I can store your PyPI login so future submissions will be faster.

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/porting-code-to-python-3-with-2to3.html b/porting-code-to-python-3-with-2to3.html index 6f00ef4..1c48f58 100644 --- a/porting-code-to-python-3-with-2to3.html +++ b/porting-code-to-python-3-with-2to3.html @@ -1344,7 +1344,7 @@ do_stuff(a_list)

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/refactoring.html b/refactoring.html index 7be2929..cfd4573 100755 --- a/refactoring.html +++ b/refactoring.html @@ -471,7 +471,7 @@ OK

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/regular-expressions.html b/regular-expressions.html index b921e2c..d18af91 100755 --- a/regular-expressions.html +++ b/regular-expressions.html @@ -282,7 +282,7 @@ body{counter-reset:h1 5}

    Case study: Parsing Phone Numbers

    - +

    So far you’ve concentrated on matching whole patterns. Either the pattern matches, or it doesn’t. But regular expressions are much more powerful than that. When a regular expression does match, you can pick out specific pieces of it. You can find out what matched where.

    This example came from another real-world problem I encountered, again from a previous day job. The problem: parsing an American phone number. The client wanted to be able to enter the number free-form (in a single field), but then wanted to store the area code, trunk, number, and optionally an extension separately in the company’s database. I scoured the Web and found many examples of regular expressions that purported to do this, but none of them were permissive enough.

    Here are the phone numbers I needed to be able to accept: @@ -436,7 +436,7 @@ AttributeError: 'NoneType' object has no attribute 'groups'

    Regular expressions are extremely powerful, but they are not the correct solution for every problem. You should learn enough about them to know when they are appropriate, when they will solve your problems, and when they will cause more problems than they solve.

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/serializing.html b/serializing.html index e74f16b..d5746de 100644 --- a/serializing.html +++ b/serializing.html @@ -655,7 +655,7 @@ NameError: name 'entry' is not defined

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/special-method-names.html b/special-method-names.html index 6ffe426..160fa94 100644 --- a/special-method-names.html +++ b/special-method-names.html @@ -840,7 +840,7 @@ def __exit__(self, *args):

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/strings.html b/strings.html index edc98c7..2e8780d 100755 --- a/strings.html +++ b/strings.html @@ -458,7 +458,7 @@ TypeError: Can't convert 'bytes' object to str implicitly

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/table-of-contents.html b/table-of-contents.html index 6fa2312..93772a7 100755 --- a/table-of-contents.html +++ b/table-of-contents.html @@ -442,5 +442,5 @@ li ol{font-weight:normal} -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/unit-testing.html b/unit-testing.html index e655a9c..6e2a263 100755 --- a/unit-testing.html +++ b/unit-testing.html @@ -818,7 +818,7 @@ OK

    And the anticlimax award of the year goes to… the word “OK”, which is printed by the unittest module when all the tests pass.

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/whats-new.html b/whats-new.html index ce2772a..774b96b 100644 --- a/whats-new.html +++ b/whats-new.html @@ -46,4 +46,4 @@ h3:before{content:''}

    Also new in Python — not in the language but in the community — is the emergence of code repositories like The Python Package Index (PyPI). Python comes with utilities to package your code in standard formats and distribute those packages on PyPI. Read Packaging Python Libraries for details. -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/where-to-go-from-here.html b/where-to-go-from-here.html index 19f3292..55616f2 100644 --- a/where-to-go-from-here.html +++ b/where-to-go-from-here.html @@ -83,6 +83,6 @@ h3:before{counter-increment:h3;content:'C.' counter(h2) '.' counter(h3) '. '}

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/xml.html b/xml.html index 821af3a..fe99b3a 100755 --- a/xml.html +++ b/xml.html @@ -670,7 +670,7 @@ lxml.etree.XMLSyntaxError: Entity 'hellip' not defined, line 3, column 28

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim diff --git a/your-first-python-program.html b/your-first-python-program.html index 325c193..a8cefc5 100755 --- a/your-first-python-program.html +++ b/your-first-python-program.html @@ -383,7 +383,7 @@ if __name__ == '__main__':

  • Python Reference Manual explains what it means to say that everything in Python is an object, because some people are pedants and like to discuss that sort of thing at great length.

    -

    © 2001–9 Mark Pilgrim +

    © 2001–10 Mark Pilgrim