[Python-ideas] BufferedIO and detach

Antoine Pitrou solipsis at pitrou.net
Tue Mar 5 22:50:37 CET 2013


On Wed, 06 Mar 2013 10:49:30 +1300
Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Antoine Pitrou wrote:
> > Le Tue, 05 Mar 2013 10:14:08 +1300,
> > Greg Ewing <greg.ewing at canterbury.ac.nz> a
> > écrit :
> 
> >>Maybe you could be allowed to read() from the buffered
> >>stream after detatching the underlying source, which
> >>would then return any data remaining in the buffer.
> > 
> > Perhaps detach() can take an optional argument for that indeed.
> 
> Does it need to be optional? Is there likely to be any
> code around that relies on read() *not* working on a
> detached stream?

detach() closes the stream by default, which is piece of behaviour you
can't change nilly-willy.

Regards

Antoine.





More information about the Python-ideas mailing list