Replaced `FileAlreadyExistsError` with the shorter `FileExistsError`
(thanks Georg)
This commit is contained in:
parent
b840946b96
commit
8fb8f70c6d
10
pep-3151.txt
10
pep-3151.txt
|
@ -330,8 +330,8 @@ New exception classes
|
|||
The following tentative list of subclasses, along with a description and
|
||||
the list of errnos mapped to them, is submitted to discussion:
|
||||
|
||||
* ``FileAlreadyExistsError``: trying to create a file or directory which
|
||||
already exists (EEXIST)
|
||||
* ``FileExistsError``: trying to create a file or directory which already
|
||||
exists (EEXIST)
|
||||
|
||||
* ``FileNotFoundError``: for all circumstances where a file and directory is
|
||||
requested but doesn't exist (ENOENT)
|
||||
|
@ -368,7 +368,7 @@ In addition, the following exception class are proposed for inclusion:
|
|||
* ``ConnectionError``: a base class for ``ConnectionAbortedError``,
|
||||
``ConnectionRefusedError`` and ``ConnectionResetError``
|
||||
|
||||
* ``FileSystemError``: a base class for ``FileAlreadyExistsError``,
|
||||
* ``FileSystemError``: a base class for ``FileExistsError``,
|
||||
``FileNotFoundError``, ``IsADirectoryError`` and ``NotADirectoryError``
|
||||
|
||||
The following drawing tries to sum up the proposed additions, along with
|
||||
|
@ -383,7 +383,7 @@ shown::
|
|||
+-- ConnectionResetError ECONNRESET
|
||||
+-- FileDescriptorError EBADF
|
||||
+-- FileSystemError
|
||||
+-- FileAlreadyExistsError EEXIST
|
||||
+-- FileExistsError EEXIST
|
||||
+-- FileNotFoundError ENOENT
|
||||
+-- IsADirectoryError EISDIR
|
||||
+-- NotADirectoryError ENOTDIR
|
||||
|
@ -396,7 +396,7 @@ Naming
|
|||
Various naming controversies can arise. One of them is whether all
|
||||
exception class names should end in "``Error``". In favour is consistency
|
||||
with the rest of the exception hiearchy, against is concision (especially
|
||||
with long names such as ``FileAlreadyExistsError``).
|
||||
with long names such as ``ConnectionAbortedError``).
|
||||
|
||||
Another cosmetic issue is whether ``FileSystemError`` should be spelled
|
||||
``FilesystemError`` instead.
|
||||
|
|
Loading…
Reference in New Issue