On 6/21/07, Guido van Rossum <[EMAIL PROTECTED]> wrote: > In my mind, seek() and tell() should work like getpos() and setpos() > in modern C stdio -- tell() returns a "cookie" whose only use is that > you can later pass it to seek() and it will reset the position in the > sequence of code units to where it was when tell() was called. For > many encodings, in practice, seek() and tell() can just use byte > positions since the boundaries between code points always fall on byte > boundaries (but not the other way around). For other encodings, the > implementation currently in io.py encodes the incremental codec state > in the (very) high bits of the cookie (this is convenient since we > have arbitrary precision integers).
If the cookie is meant to be opaque to the caller, is there a reason that the cookie must be an integer? Specifying the return type as opaque might also reduce the temptation to do perform arithmetic on them, which will work for some codecs (ASCII), but break later in odd ways for others. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com