On Sun, Sep 27, 2009 at 3:44 PM, Antoine Pitrou <solip...@pitrou.net> wrote:
> Le Sun, 27 Sep 2009 14:24:52 -0700, Guido van Rossum a écrit :
> [truncate()]
>>
>> What compatibility, though?
>
> Compatibility accross the 3.x line.

Well, in this case, maybe compatibility with 2.x is more important --
this isn't something we can easily warn about in 2.6+. In addition
there's the POSIX rules.

>> f.truncate() behaves different in 2.x than
>> in 3.x, and in 2.x it seems to match the POSIX semantics (i.e. the seek
>> position is unchanged even though the file size is). Perhaps the changed
>> semantics was an oversight or a mistake?
>
> Perhaps it was, indeed. I don't know who made that decision in the first
> place.

It might well have been me (when implementing the earliest version of
io.py), and I might well have *though* that I implemented the same
rules as 2.x, and never bothered to check. :-(

All in all I think we should change this before it's too late; it will
affect a very small number of apps (perhaps none?), but I would rather
have the right semantics in the future. Also, it's trivial to write
code that doesn't care (in fact code running under 2.x and 3.x
probably will have to be written so that it doesn't care) so it's not
like changing this is going to make life harder for people wanting
multiple-version support.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to