[docs] documentation suggestion

Faheem Mitha faheem at email.unc.edu
Sun Jan 23 11:27:35 CET 2011


Hi,

In http://docs.python.org/library/functions.html#open

"Modes 'r+', 'w+' and 'a+' open the file for updating (note that 'w+' 
truncates the file)."

The term "open the file for updating" means nothing to me in this context. 
>From other place I learned this means that 'w+' means open for both 
writing and reading and creates file if it does not exist and truncates 
file if it exists. 'a+' means appending and reading. 'r+' also means open 
for reading and writing but does not create file if it does not exist, as 
well as does not truncate the file if it does exist.

I'm still not exactly clear what the difference between 'r+' and 'a+' is 
then, if 'r+' does not truncate the file.

In any case, I suggest removing the word 'updating' and adding a 
description of what the '+' actually does.

See 
http://stackoverflow.com/questions/1466000/python-open-built-in-function-difference-between-modes-a-a-w-w

and similar stuff on the net for confusion about this.

                                                           Regards, Faheem


More information about the docs mailing list