[Python-3000] Draft PEP for New IO system

Jim Jewett jimjjewett at gmail.com
Tue Feb 27 23:17:50 CET 2007

On 2/27/07, Guido van Rossum <guido at python.org> wrote:
> On 2/27/07, Jim Jewett <jimjjewett at gmail.com> wrote:

> > Therefore, normal code can ignore the possibility, or (to be really
> > robust against someone else messing with the input stream) add an "if
> > result is None: continue" clause to its loops.

> No, since that would mean busy-waiting while the I/O isn't ready,

Then should I assume that:

(1)  Read with a timeout is in the "better know your concrete object" category.

(2)  Dealing with possibly unready objects in a library/framework
(yield the timeslot?) should generally be framework specific.

> FWIW we just discovered that the buffered writers need a __del__
> method that calls flush()...

All they really need is a __close__ method -- you don't want it to
cause gc cycles, and it is OK if the flush happens more than once.

(I'll stop for now, as the __del__ semantics are a different long thread.)


More information about the Python-3000 mailing list