diff options
author | Fred Drake <fdrake@acm.org> | 2000-09-22 04:12:27 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-09-22 04:12:27 (GMT) |
commit | 343ad7a572b8cd4c877f6db6e927e3104e6d65a4 (patch) | |
tree | 11764eac62967d9181414cd78434fb88e5263e6c /Doc | |
parent | ab7983939b2b9f3f1cce5d7b859e97d94052bad6 (diff) | |
download | cpython-343ad7a572b8cd4c877f6db6e927e3104e6d65a4.zip cpython-343ad7a572b8cd4c877f6db6e927e3104e6d65a4.tar.gz cpython-343ad7a572b8cd4c877f6db6e927e3104e6d65a4.tar.bz2 |
Correct some bitrot; some things have become inaccurate in the tutorial.
<file>.readlines() does not call <file>.readline() internally anymore,
and the sizehint parameter should be mentioned briefly.
Some displays of floating point numbers needed to be updated due to the
change in the repr() of floats (from 1.6).
Both issues were noted by Aahz <aahz@panix.com>.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/tut/tut.tex | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex index 0378ba4..6927afe 100644 --- a/Doc/tut/tut.tex +++ b/Doc/tut/tut.tex @@ -488,11 +488,11 @@ example: >>> tax = 17.5 / 100 >>> price = 3.50 >>> price * tax -0.6125 +0.61249999999999993 >>> price + _ -4.1125 +4.1124999999999998 >>> round(_, 2) -4.11 +4.1100000000000003 \end{verbatim} This variable should be treated as read-only by the user. Don't @@ -2780,8 +2780,12 @@ string containing only a single newline. '' \end{verbatim} -\code{f.readlines()} uses \code{f.readline()} repeatedly, and returns -a list containing all the lines of data in the file. +\code{f.readlines()} returns a list containing all the lines of data +in the file. If given an optional parameter \var{sizehint}, it reads +that many bytes from the file and enough more to complete a line, and +returns the lines from that. This is often used to allow efficient +reading of a large file by lines, but without having to load the +entire file in memory. Only complete lines will be returned. \begin{verbatim} >>> f.readlines() |