Guido van Rossum guido@beopen.com
Fri, 28 Jul 2000 09:33:32 -0500

> >Almost right.  The docs for file objects specifically imply that a
> >negative arg to readline() or a zero arg to readlines() is the same as
> >no args; your defaults are sys.maxint so an explicit -1 or 0 won't do
> >the right thing. (This is important for wrapper classes that want to
>
> Which docs say this?  I looked at Doc/lib/libstdtypes.tex to get the
> semantics:
>
>   ...   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}

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.

>   ... If the optional \var{sizehint} argument is
>   approximately \var{sizehint} bytes (possibly after rounding up to an
>   internal buffer size) are read.
> \end{methoddesc}

Here you're right -- I got the 0 from the code.  It should be
documented.

> 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.

Agreed.