Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 662d76e

Browse files
committed
Fix typos and errors noticed by Skip Montanaro
1 parent c380466 commit 662d76e

1 file changed

Lines changed: 19 additions & 14 deletions

File tree

Doc/whatsnew/whatsnew20.tex

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
\documentclass{howto}
22

33
\title{What's New in Python 1.6}
4-
\release{0.02}
4+
\release{0.03}
55
\author{A.M. Kuchling and Moshe Zadka}
66
\authoraddress{\email{[email protected]}, \email{[email protected]} }
77
\begin{document}
@@ -55,14 +55,15 @@ \section{Unicode}
5555
by \code{\e 777}.
5656

5757
Unicode strings, just like regular strings, are an immutable sequence
58-
type, so they can be indexed and sliced. They also have an
59-
\method{encode( \optional{\var{encoding}} )} method that returns an
60-
8-bit string in the desired encoding. Encodings are named by strings,
61-
such as \code{'ascii'}, \code{'utf-8'}, \code{'iso-8859-1'}, or
62-
whatever. A codec API is defined for implementing and registering new
63-
encodings that are then available throughout a Python program. If an
64-
encoding isn't specified, the default encoding is usually 7-bit ASCII,
65-
though it can be changed for your Python installation by calling the
58+
type. They can be indexed and sliced, but not modified in place.
59+
Unicode strings have an \method{encode( \optional{\var{encoding}} )} method
60+
that returns an 8-bit string in the desired encoding. Encodings are
61+
named by strings, such as \code{'ascii'}, \code{'utf-8'},
62+
\code{'iso-8859-1'}, or whatever. A codec API is defined for
63+
implementing and registering new encodings that are then available
64+
throughout a Python program. If an encoding isn't specified, the
65+
default encoding is usually 7-bit ASCII, though it can be changed for
66+
your Python installation by calling the
6667
\function{sys.setdefaultencoding(\var{encoding})} function in a
6768
customized version of \file{site.py}.
6869

@@ -352,8 +353,8 @@ \section{Porting to 1.6}
352353
353354
Taking the \function{repr()} of a float now uses a different
354355
formatting precision than \function{str()}. \function{repr()} uses
355-
``%.17g'' format string for C's \function{sprintf()}, while
356-
\function{str()} uses ``%.12g'' as before. The effect is that
356+
\code{\%.17g} format string for C's \function{sprintf()}, while
357+
\function{str()} uses \code{\%.12g} as before. The effect is that
357358
\function{repr()} may occasionally show more decimal places than
358359
\function{str()}, for numbers
359360
For example, the number 8.1 can't be represented exactly in binary, so
@@ -437,14 +438,18 @@ \section{Core Changes}
437438
Win64 because it seems that for ease of porting, MS Visual C++ treats code
438439
as 32 bit.
439440
) PythonWin also supports Windows CE; see the Python CE page at
440-
\url{http://www.python.net/crew/mhammond/ce/} for more information.
441+
\url{http://starship.python.net/crew/mhammond/ce/} for more information.
441442
442443
An attempt has been made to alleviate one of Python's warts, the
443444
often-confusing \exception{NameError} exception when code refers to a
444445
local variable before the variable has been assigned a value. For
445446
example, the following code raises an exception on the \keyword{print}
446447
statement in both 1.5.2 and 1.6; in 1.5.2 a \exception{NameError}
447-
exception is raised, while 1.6 raises \exception{UnboundLocalError}.
448+
exception is raised, while 1.6 raises a new
449+
\exception{UnboundLocalError} exception.
450+
\exception{UnboundLocalError} is a subclass of \exception{NameError},
451+
so any existing code that expects \exception{NameError} to be raised
452+
should still work.
448453
449454
\begin{verbatim}
450455
def f():
@@ -483,7 +488,7 @@ \section{Extending/Embedding Changes}
483488
484489
The \file{Python/importdl.c} file, which was a mass of \#ifdefs to
485490
support dynamic loading on many different platforms, was cleaned up
486-
are reorganized by Greg Stein. \file{importdl.c} is now quite small,
491+
and reorganized by Greg Stein. \file{importdl.c} is now quite small,
487492
and platform-specific code has been moved into a bunch of
488493
\file{Python/dynload_*.c} files.
489494

0 commit comments

Comments
 (0)