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

Skip to content

Commit aac8c58

Browse files
committed
Various markup changes.
1 parent 42b567f commit aac8c58

1 file changed

Lines changed: 22 additions & 20 deletions

File tree

Doc/whatsnew/whatsnew23.tex

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
\title{What's New in Python 2.3}
55
\release{0.08}
6-
\author{A.M. Kuchling}
6+
\author{A.M.\ Kuchling}
77
\authoraddress{\email{[email protected]}}
88

99
\begin{document}
@@ -173,11 +173,11 @@ \section{PEP 255: Simple Generators\label{section-generators}}
173173
the function will resume executing immediately after the
174174
\keyword{yield} statement. (For complicated reasons, the
175175
\keyword{yield} statement isn't allowed inside the \keyword{try} block
176-
of a \code{try...finally} statement; read \pep{255} for a full
176+
of a \keyword{try}...\keyword{finally} statement; read \pep{255} for a full
177177
explanation of the interaction between \keyword{yield} and
178178
exceptions.)
179179

180-
Here's a sample usage of the \function{generate_ints} generator:
180+
Here's a sample usage of the \function{generate_ints()} generator:
181181

182182
\begin{verbatim}
183183
>>> gen = generate_ints(3)
@@ -472,7 +472,7 @@ \section{PEP 282: The \module{logging} Package}
472472
There's also an \function{exception()} function that records the most
473473
recent traceback. Any of the other functions will also record the
474474
traceback if you specify a true value for the keyword argument
475-
\code{exc_info}.
475+
\var{exc_info}.
476476

477477
\begin{verbatim}
478478
def f():
@@ -510,7 +510,7 @@ \section{PEP 282: The \module{logging} Package}
510510
Log records are usually propagated up the hierarchy, so a message
511511
logged to \samp{server.auth} is also seen by \samp{server} and
512512
\samp{root}, but a handler can prevent this by setting its
513-
\member{propagate} attribute to \code{False}.
513+
\member{propagate} attribute to \constant{False}.
514514

515515
There are more classes provided by the \module{logging} package that
516516
can be customized. When a \class{Logger} instance is told to log a
@@ -683,10 +683,10 @@ \section{PEP 273: Importing Modules from Zip Archives}
683683

684684
An entry in \code{sys.path} can now be the filename of a ZIP archive.
685685
The ZIP archive can contain any kind of files, but only files named
686-
\code{*.py}, \code{*.pyc}, or \code{*.pyo} can be imported. If an
687-
archive only contains \code{*.py} files, Python will not attempt to
688-
modify the archive by adding the corresponding \code{*.pyc} file, meaning
689-
that if a ZIP archive doesn't contain \code{*.pyc} files, importing may be
686+
\file{*.py}, \file{*.pyc}, or \file{*.pyo} can be imported. If an
687+
archive only contains \file{*.py} files, Python will not attempt to
688+
modify the archive by adding the corresponding \file{*.pyc} file, meaning
689+
that if a ZIP archive doesn't contain \file{*.pyc} files, importing may be
690690
rather slow.
691691

692692
A path within the archive can also be specified to only import from a
@@ -767,14 +767,14 @@ \section{PEP 302: New Import Hooks \label{section-pep302}}
767767

768768
\begin{itemize}
769769
\item \code{sys.path_hooks} is a list of callable objects; most
770-
often they'll be classes. Each callable takes a string containing
771-
a path and either returns an importer object that will handle imports
772-
from this path or raises an \exception{ImportError} exception if it
773-
can't handle this path.
770+
often they'll be classes. Each callable takes a string containing a
771+
path and either returns an importer object that will handle imports
772+
from this path or raises an \exception{ImportError} exception if it
773+
can't handle this path.
774774

775775
\item \code{sys.path_importer_cache} caches importer objects for
776-
each path, so \code{sys.path_hooks} will only need to be traversed
777-
once for each path.
776+
each path, so \code{sys.path_hooks} will only need to be traversed
777+
once for each path.
778778

779779
\item \code{sys.meta_path} is a list of importer objects that will
780780
be traversed before \code{sys.path} is checked. This list is
@@ -927,8 +927,9 @@ \section{Extended Slices\label{section-slices}}
927927

928928
To simplify implementing sequences that support extended slicing,
929929
slice objects now have a method \method{indices(\var{length})} which,
930-
given the length of a sequence, returns a \code{(start, stop, step)}
931-
tuple that can be passed directly to \function{range()}.
930+
given the length of a sequence, returns a \code{(\var{start},
931+
\var{stop}, \var{step})} tuple that can be passed directly to
932+
\function{range()}.
932933
\method{indices()} handles omitted and out-of-bounds indices in a
933934
manner consistent with regular slices (and this innocuous phrase hides
934935
a welter of confusing details!). The method is intended to be used
@@ -1118,7 +1119,7 @@ \subsection{String Changes}
11181119

11191120
\begin{itemize}
11201121

1121-
\item The \code{in} operator now works differently for strings.
1122+
\item The \keyword{in} operator now works differently for strings.
11221123
Previously, when evaluating \code{\var{X} in \var{Y}} where \var{X}
11231124
and \var{Y} are strings, \var{X} could only be a single character.
11241125
That's now changed; \var{X} can be a string of any length, and
@@ -1405,7 +1406,8 @@ \section{New, Improved, and Deprecated Modules}
14051406

14061407
\item The \function{sample(\var{population}, \var{k})} function was
14071408
added to the \module{random} module. \var{population} is a sequence
1408-
or \code{xrange} object containing the elements of a population, and \function{sample()}
1409+
or \class{xrange} object containing the elements of a population, and
1410+
\function{sample()}
14091411
chooses \var{k} elements from the population without replacing chosen
14101412
elements. \var{k} can be any value up to \code{len(\var{population})}.
14111413
For example:
@@ -1933,7 +1935,7 @@ \section{Build and C API Changes}
19331935
\constant{METH_NOARGS} flag, signalling that there are no arguments, and
19341936
the argument checking can then be removed. If compatibility with
19351937
pre-2.2 versions of Python is important, the code could use
1936-
\code{PyArg_ParseTuple(args, "")} instead, but this will be slower
1938+
\code{PyArg_ParseTuple(\var{args}, "")} instead, but this will be slower
19371939
than using \constant{METH_NOARGS}.
19381940

19391941
\item A new function, \cfunction{PyObject_DelItemString(\var{mapping},

0 commit comments

Comments
 (0)