[Python-3000] iostack, second revision

Jim Jewett jimjjewett at gmail.com
Fri Sep 8 21:04:50 CEST 2006


On 9/8/06, Antoine Pitrou <solipsis at pitrou.net> 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

-jJ


More information about the Python-3000 mailing list