Re: [Patch #100740] gzip: readline(), readlines() patch

On Fri, Jul 28, 2000 at 03:25:36AM -0700, noreply@sourceforge.net wrote:
Which docs say this? I looked at Doc/lib/libstdtypes.tex to get the semantics: \begin{methoddesc}[file]{readline}{\optional{size}} ... If the \var{size} argument is present and non-negative, it is a maximum byte count (including the trailing newline) and an incomplete line may be returned. ... \end{methoddesc} \begin{methoddesc}[file]{readlines}{\optional{sizehint}} ... If the optional \var{sizehint} argument is present, instead of reading up to \EOF{}, whole lines totalling approximately \var{sizehint} bytes (possibly after rounding up to an internal buffer size) are read. \end{methoddesc} Neither text mentions the special cases for -1 and 0 in each function. Fixing the patch to get this right is trivial, but I think the docs need to be updated to mention this. --amk

I read this that any negative argument has the same effect as an absent argument. I suggested -1 as a typical negative number. The doc could be more explicit though.
Here you're right -- I got the 0 from the code. It should be documented.
Agreed. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)

I read this that any negative argument has the same effect as an absent argument. I suggested -1 as a typical negative number. The doc could be more explicit though.
Here you're right -- I got the 0 from the code. It should be documented.
Agreed. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
participants (2)
-
Andrew Kuchling
-
Guido van Rossum