On Wed, 28 Feb 2007 07:39:33 -0600, Daniel Stutzbach <[EMAIL PROTECTED]> wrote:
>
> [snip]
>
>> - Should read()/readinto() raise EOFError?
>
>On EOF, they return a length-0 object or 0 instead. If the user tries
>to read again *after* hitting EOF, then an EOFError is raised.
>
What is the motivation for having two different ways to signal EOF? How
is this case handled?
>>> f = file('name', 'w')
>>> g = file('name', 'r')
>>> g.read(10)
''
>>> f.write('bytes')
>>> f.flush()
>>> g.read(10)
'bytes'
>>>
Jean-Paul
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com