[Python-3000] On PEP 3116: new I/O base classes

Jim Jewett jimjjewett at gmail.com
Wed Jun 20 20:33:10 CEST 2007


On 6/20/07, Bill Janssen <janssen at parc.com> wrote:
> Not bad, but if you're going that route, I think I'd get rid of the
> optional arguments, and just say
>
>     seek_from_beginning(INCR: int)
>
>     seek_from_current(INCR: int)
>
>     seek_from_end(DECR: int)


    goto(pos)  # absolute

    move(incr:int)  # relative to current position

negative numbers can be interpreted naturally; for move they go
backwards, and for goto they count from the end.

This would require either a length, or a special value (None?) for at
least one of Start and End, because 0 == -0.

Note that this makes sense for bytes; I'm not sure exactly how unicode
characters even should be counted, without a normalization promise.

-jJ


More information about the Python-3000 mailing list