On Sun, Sep 27, 2009 at 4:33 AM, Antoine Pitrou <solip...@pitrou.net> wrote: >> So here is the proposed semantic, which matches established conventions: >> >> *IOBase.truncate(n: int = None) -> int* > [...] > > I still don't think there is a sufficient benefit in breaking > compatibility. If you want the file pointer to remain the same, you can > save it first and restore it afterwards manually.
What compatibility, though? 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? -- --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