Greg Ewing wrote:
> tomer filiba wrote:
> 
>> okay, i give up on read(n) returning n bytes.
> 
> An idea I had about this some time ago was that read()
> could be callable with two arguments:
> 
>    f.read(min_bytes, max_bytes)
> 
> The two variations we're considering would then be special
> cases of this:
> 
>    f.read(0, num_bytes)         # current read() behaviour
> 
>    f.read(num_bytes, num_bytes) # record-oriented read() behaviour

You can even makes this backwards compatible by having the min_bytes argument 
default to 0. (whether or not the order of the two arguments should be 
reversed in that case is debatable, though)

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
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

Reply via email to