Jim Jewett wrote:
> On 9/8/06, Antoine Pitrou <[EMAIL PROTECTED]> wrote:
>> Le vendredi 08 septembre 2006 à 11:06 -0700, Guido van Rossum a écrit :
>>> -1 on those particular cryptic names. Which one of seekby() and
>>> rseek() is the relative seek? Where's the seek relative to EOF?
>
>> What about seek(), seek_relative() and seek_reverse() ?
>
> Why not just borrow the standard symbolic names of cur and end?
>
> seek(pos=0)
> seek_cur(pos=0)
> seek_end(pos=0)
>
> seek_end(-1000) <==> 1000 units (bytes or chars or records or
> ...) before the end
> seek_cur(50) <==> 50 units beyond current
> seek() <==> beginning
+1 here. Short, to the point, and easy to remember for anyone already familiar
with seek().
Cheers,
Nick.
P.S. on a slightly different topic, it would be nice if f.seek(-1) raised
ValueError instead of IOError. Passing a negative absolute seek value is a
program bug, not an environment problem.
--
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