mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #12760: Refer to the new 'x' open mode as "exclusive creation" mode.
This commit is contained in:
parent
138f4656e3
commit
d612de10e5
4 changed files with 13 additions and 12 deletions
|
@ -1066,9 +1066,9 @@ PyDoc_STRVAR(fileio_doc,
|
|||
"file(name: str[, mode: str][, opener: None]) -> file IO object\n"
|
||||
"\n"
|
||||
"Open a file. The mode can be 'r', 'w', 'x' or 'a' for reading (default),\n"
|
||||
"writing, creating or appending. The file will be created if it doesn't\n"
|
||||
"exist when opened for writing or appending; it will be truncated when\n"
|
||||
"opened for writing. A `FileExistsError` will be raised if it already\n"
|
||||
"writing, exclusive creation or appending. The file will be created if it\n"
|
||||
"doesn't exist when opened for writing or appending; it will be truncated\n"
|
||||
"when opened for writing. A `FileExistsError` will be raised if it already\n"
|
||||
"exists when opened for creating. Opening a file for creating implies\n"
|
||||
"writing so this mode behaves in a similar way to 'w'.Add a '+' to the mode\n"
|
||||
"to allow simultaneous reading and writing. A custom opener can be used by\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue