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

Skip to content

Commit 44a31e1

Browse files
committed
Use 'input' as variable name, even though it shadows a built-in
Remove applications of rsplit() and random numbers Typo fixes; minor tweaks
1 parent 6237ef1 commit 44a31e1

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

Doc/whatsnew/whatsnew24.tex

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ \section{PEP 322: Reverse Iteration}
109109
a list with \function{list()}.
110110

111111
\begin{verbatim}
112-
>>> data = open('/etc/passwd', 'r')
113-
>>> for line in reversed(list(data)):
112+
>>> input= open('/etc/passwd', 'r')
113+
>>> for line in reversed(list(input)):
114114
... print line
115115
...
116116
root:*:0:0:System Administrator:/var/root:/bin/tcsh
@@ -137,8 +137,7 @@ \section{Other Language Changes}
137137

138138
\item Strings also gained an \method{rsplit()} method that
139139
works like the \method{split()} method but splits from the end of
140-
the string. Possible applications include splitting a filename
141-
from a path or a domain name from URL.
140+
the string.
142141

143142
\begin{verbatim}
144143
>>> 'a b c'.split(None, 1)
@@ -236,7 +235,7 @@ \section{Other Language Changes}
236235

237236
\item The \function{zip()} built-in function and \function{itertools.izip()}
238237
now return an empty list instead of raising a \exception{TypeError}
239-
exception if called with no arguments. This makes the function more
238+
exception if called with no arguments. This makes them more
240239
suitable for use with variable length argument lists:
241240

242241
\begin{verbatim}
@@ -354,9 +353,9 @@ \section{New, Improved, and Deprecated Modules}
354353

355354
Note that \function{tee()} has to keep copies of the values returned
356355
by the iterator; in the worst case, it may need to keep all of them.
357-
This should therefore be used carefully if there the leading iterator
356+
This should therefore be used carefully if the leading iterator
358357
can run far ahead of the trailing iterator in a long stream of inputs.
359-
If the separation is large, then it becomes preferrable to use
358+
If the separation is large, then it becomes preferable to use
360359
\function{list()} instead. When the iterators track closely with one
361360
another, \function{tee()} is ideal. Possible applications include
362361
bookmarking, windowing, or lookahead iterators.
@@ -385,8 +384,7 @@ \section{New, Improved, and Deprecated Modules}
385384
\item The \module{random} module has a new method called \method{getrandbits(N)}
386385
which returns an N-bit long integer. This method supports the existing
387386
\method{randrange()} method, making it possible to efficiently generate
388-
arbitrarily large random numbers (suitable for prime number generation in
389-
RSA applications for example).
387+
arbitrarily large random numbers.
390388

391389
\item The regular expression language accepted by the \module{re} module
392390
was extended with simple conditional expressions, written as

0 commit comments

Comments
 (0)