Steven D'Aprano wrote:

Using "truncate" to mean "increase in size" makes about as much sense as having a list method called "remove" used to insert items. I can't imagine what the committee who approved this were thinking.

I expect the reason is historical. Some time back in the
early days of Unix, someone wanted a way of chopping back
files, so they added a truncate() system call. Then someone
else noticed that it would happily accept an argument greater
than the existing length, and it seemed like that could
be useful behaviour, so they documented it and left it that way.

Then the POSIX committee came along and incorporated it into
the standard so as to be compatible with existing practice.

--
Greg
_______________________________________________
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