Re: Writev

2004-12-21 Thread Adam DePrince
On Sun, 2004-12-19 at 23:43, Jp Calderone wrote: > On Sun, 19 Dec 2004 23:12:27 -0500, Adam DePrince <[EMAIL PROTECTED]> wrote: > > [snip] > > > > Of course, to take advantage of this requires that writev be exposed. I > > have an implementation of writev. This implementation is reasonably > > s

Re: Writev

2004-12-20 Thread Mike Meyer
Adam DePrince <[EMAIL PROTECTED]> writes: > I want to include it because POSIX has a single OS call that > conceptually maps pretty closely to writelines. I just want to point out that on some systems, POSIX is a compatability layer, not an OS layer. On those systems, the implementer of writev is

Re: Writev

2004-12-20 Thread Steven Bethard
Adam DePrince wrote: [snip great explanation] I want to include it because POSIX has a single OS call that conceptually maps pretty closely to writelines. writev can be faster because you don't have to do memory copies to buffer data in one place for it -- the OS will do that, and can sometimes de

Re: Writev

2004-12-20 Thread Adam DePrince
On Mon, 2004-12-20 at 02:18, Steven Bethard wrote: > Adam DePrince wrote: > > file.writelines( seq ) and map( file.write, seq ) are the same; the > > former is syntactic sugar for the later. > > Well, that's not exactly true. For one thing, map(file.write, seq) > returns a list of Nones, while f

Re: Writev

2004-12-19 Thread Steven Bethard
Adam DePrince wrote: file.writelines( seq ) and map( file.write, seq ) are the same; the former is syntactic sugar for the later. Well, that's not exactly true. For one thing, map(file.write, seq) returns a list of Nones, while file.writelines returns only the single None that Python functions w

Re: Writev

2004-12-19 Thread Adam DePrince
On Mon, 2004-12-20 at 00:30, Steven Bethard wrote: > Adam DePrince wrote: > > Many other programmers have faced a similar issue; cStringIO, > > ''.join([mydata]), map( file.write, [mydata]) are but some attempts at > > making this process more efficient by jamming the components to be > > written i

Re: Writev

2004-12-19 Thread Adam DePrince
On Sun, 2004-12-19 at 23:43, Jp Calderone wrote: > On Sun, 19 Dec 2004 23:12:27 -0500, Adam DePrince <[EMAIL PROTECTED]> wrote: > > [snip] [snip] to free the memory, of course. > > The support of iterators is a cool idea, but I'm not sure > it is actually useful. Consider the case where not

Re: Writev

2004-12-19 Thread Steven Bethard
Adam DePrince wrote: Many other programmers have faced a similar issue; cStringIO, ''.join([mydata]), map( file.write, [mydata]) are but some attempts at making this process more efficient by jamming the components to be written into a sequence. I'm obviously misunderstanding something because I ca

Re: Writev

2004-12-19 Thread Jp Calderone
On Sun, 19 Dec 2004 23:12:27 -0500, Adam DePrince <[EMAIL PROTECTED]> wrote: > [snip] > > Of course, to take advantage of this requires that writev be exposed. I > have an implementation of writev. This implementation is reasonably > smart, it "unrolls" only so as many iteration.next calls as ne