Re: [Python-3000] revamping the io stack, part 2

2006-05-04 Thread Marcin 'Qrczak' Kowalczyk
"tomer filiba" <[EMAIL PROTECTED]> writes: > read(x) guarantees to return x bytes, or EOFError otherwise > (and also restoing the stream position). This is a poor choice of the fundamental operation. For example when recoding bytes to characters, an analogous interface for a character stream is i

Re: [Python-3000] revamping the io stack, part 2

2006-05-03 Thread Liu Jin
> "tomer" == tomer filiba <[EMAIL PROTECTED]> writes: > read(x) guarantees to return x bytes, or EOFError otherwise (and > also restoing the stream position). This would require arbitrarily large buffer for a socket stream. I'm unsure if that's desiable. Maybe you could move the buff

Re: [Python-3000] revamping the io stack, part 2

2006-04-30 Thread Robin Bryce
>> def async_read(self, count, callback) >> def async_write(self, data, callback) >I think many people would be happy if the proposal would use the >Deferred abstraction which is built in Twisted. :-) I almost agree. Not sure whether a Defered implementation in python core would be prefe

Re: [Python-3000] revamping the io stack, part 2

2006-04-30 Thread Antoine Pitrou
Le samedi 29 avril 2006 à 21:10 +0200, tomer filiba a écrit : > and if we do that already, perhaps we should introduce async > operations as a > built-in feature? .NET does (BeginRead, EndRead, etc.) > def async_read(self, count, callback) > def async_write(self, data, callback) I think m

Re: [Python-3000] revamping the io stack, part 2

2006-04-30 Thread tomer filiba
and one small thing i forgot to mention -- file.read/write work with the new bytes() type, while textfile.read/write work with strings (depends on the encoding) -tomer On 4/30/06, tomer filiba <[EMAIL PROTECTED]> wrote: > > I don't > > want to make the 90% case require hardly any memorizing of

Re: [Python-3000] revamping the io stack, part 2

2006-04-30 Thread tomer filiba
> I don't > want to make the 90% case require hardly any memorizing of what > readers I need in what order. ... > See, this is what I am worried about. I **really** like not having to > figure out what I need to do to read by lines from a file. If the > FileStream object had an __iter__ that did

Re: [Python-3000] revamping the io stack, part 2

2006-04-29 Thread Terry Reedy
"Brett Cannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > See, this is what I am worried about. I **really** like not having to > figure out what I need to do to read by lines from a file. If the > FileStream object had an __iter__ that did the proper wrapping with > LinedBuf

Re: [Python-3000] revamping the io stack, part 2

2006-04-29 Thread Brett Cannon
On 4/29/06, tomer filiba <[EMAIL PROTECTED]> wrote: > i first thought on focusing on the socket module, because it's the part that > bothers me most, but since people have expressed their thoughts on > completely > revamping the IO stack, perhaps we should be open to adopting new ideas, > mainly fr

[Python-3000] revamping the io stack, part 2

2006-04-29 Thread tomer filiba
i first thought on focusing on the socket module, because it's the part thatbothers me most, but since people have expressed their thoughts on completelyrevamping the IO stack, perhaps we should be open to adopting new ideas, mainly from the java/.NET world (keeping the momentum from the previous p