Jim Jewett wrote:
> I would write it as
> 
> # Create a record-size pad outside the loop
> pad = " "*length
> ...
>    seq = (seq+pad)[:length]

I'd generally do padding to a fixed length that way as well, but any code 
relying on the current 'clip to 0' behaviour would break if this changed. 
Without a really compelling reason to change it, it's hard to justify any 
breakage at all (even if there may be better ways of doing things).

While I take your point about the comparison to __index__, the difference is 
that clipping sequence repetition to 0 has been the expected behaviour for 
many releases, whereas in the __index__ overflow case the expected behaviour 
was for the code to raise an exception.

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