Daniel Stutzbach wrote:
> 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.
seek() & tell() are already documented as using opaque cookies for text
files (quote is from the documentation of file.seek()):
If the file is opened in text mode (without 'b'), only offsets
returned by tell() are legal. Use of other offsets causes
undefined behavior.
(Seeking to an arbitrary byte index on a file with DOS line endings may
put you in the middle of a \r\n sequence, which may cause weirdness)
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