From d4c77bbc9279cd57cdf670f2ea6236f3f089b834 Mon Sep 17 00:00:00 2001 From: cocoatomo Date: Wed, 29 Mar 2017 09:35:58 +0900 Subject: [PATCH 1/7] Keep the standard exception table up-to-date. --- Doc/c-api/exceptions.rst | 73 ++++++++++++++++++++++++++++++---------- 1 file changed, 55 insertions(+), 18 deletions(-) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 037b85cfd117542..de21653a718813b 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -753,43 +753,45 @@ the variables: +-----------------------------------------+---------------------------------+----------+ | C Name | Python Name | Notes | +=========================================+=================================+==========+ -| :c:data:`PyExc_BaseException` | :exc:`BaseException` | \(1) | -+-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_Exception` | :exc:`Exception` | \(1) | -+-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_ArithmeticError` | :exc:`ArithmeticError` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_LookupError` | :exc:`LookupError` | \(1) | -+-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_AssertionError` | :exc:`AssertionError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_AttributeError` | :exc:`AttributeError` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_BaseException` | :exc:`BaseException` | \(1) | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_BlockingIOError` | :exc:`BlockingIOError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_BrokenPipeError` | :exc:`BrokenPipeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ChildProcessError` | :exc:`ChildProcessError` | | +| :c:data:`PyExc_BufferError` | :exc:`BufferError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ConnectionError` | :exc:`ConnectionError` | | +| :c:data:`PyExc_ChildProcessError` | :exc:`ChildProcessError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_ConnectionAbortedError` | :exc:`ConnectionAbortedError` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_ConnectionError` | :exc:`ConnectionError` | | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_ConnectionRefusedError` | :exc:`ConnectionRefusedError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_ConnectionResetError` | :exc:`ConnectionResetError` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_EOFError` | :exc:`EOFError` | | ++-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_Exception` | :exc:`Exception` | \(1) | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_FileExistsError` | :exc:`FileExistsError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_FileNotFoundError` | :exc:`FileNotFoundError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_EOFError` | :exc:`EOFError` | | -+-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_FloatingPointError` | :exc:`FloatingPointError` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_GeneratorExit` | :exc:`GeneratorExit` | | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_ImportError` | :exc:`ImportError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ModuleNotFoundError` | :exc:`ModuleNotFoundError` | | +| :c:data:`PyExc_IndentationError` | :exc:`IndentationError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_IndexError` | :exc:`IndexError` | | +-----------------------------------------+---------------------------------+----------+ @@ -801,8 +803,12 @@ the variables: +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_KeyboardInterrupt` | :exc:`KeyboardInterrupt` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_LookupError` | :exc:`LookupError` | \(1) | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_MemoryError` | :exc:`MemoryError` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_ModuleNotFoundError` | :exc:`ModuleNotFoundError` | | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_NameError` | :exc:`NameError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_NotADirectoryError` | :exc:`NotADirectoryError` | | @@ -823,16 +829,32 @@ the variables: +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_RuntimeError` | :exc:`RuntimeError` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_StopAsyncIteration` | :exc:`StopAsyncIteration` | | ++-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_StopIteration` | :exc:`StopIteration` | | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_SyntaxError` | :exc:`SyntaxError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_SystemError` | :exc:`SystemError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_TimeoutError` | :exc:`TimeoutError` | | -+-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_SystemExit` | :exc:`SystemExit` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_TabError` | :exc:`TabError` | | ++-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_TimeoutError` | :exc:`TimeoutError` | | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_TypeError` | :exc:`TypeError` | | +-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UnboundLocalError` | :exc:`UnboundLocalError` | | ++-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UnicodeDecodeError` | :exc:`UnicodeDecodeError` | | ++-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UnicodeEncodeError` | :exc:`UnicodeEncodeError` | | ++-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UnicodeError` | :exc:`UnicodeError` | | ++-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UnicodeTranslateError` | :exc:`UnicodeTranslateError` | | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_ValueError` | :exc:`ValueError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_ZeroDivisionError` | :exc:`ZeroDivisionError` | | @@ -849,8 +871,10 @@ the variables: and :c:data:`PyExc_TimeoutError` were introduced following :pep:`3151`. .. versionadded:: 3.5 - :c:data:`PyExc_RecursionError`. + :c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`. +.. versionadded:: 3.6 + :c:data:`PyExc_ModuleNotFoundError`. These are compatibility aliases to :c:data:`PyExc_OSError`: @@ -869,29 +893,34 @@ These are compatibility aliases to :c:data:`PyExc_OSError`: .. index:: - single: PyExc_BaseException - single: PyExc_Exception single: PyExc_ArithmeticError - single: PyExc_LookupError single: PyExc_AssertionError single: PyExc_AttributeError + single: PyExc_BaseException single: PyExc_BlockingIOError single: PyExc_BrokenPipeError - single: PyExc_ConnectionError + single: PyExc_BufferError + single: PyExc_ChildProcessError single: PyExc_ConnectionAbortedError + single: PyExc_ConnectionError single: PyExc_ConnectionRefusedError single: PyExc_ConnectionResetError single: PyExc_EOFError + single: PyExc_Exception single: PyExc_FileExistsError single: PyExc_FileNotFoundError single: PyExc_FloatingPointError + single: PyExc_GeneratorExit single: PyExc_ImportError + single: PyExc_IndentationError single: PyExc_IndexError single: PyExc_InterruptedError single: PyExc_IsADirectoryError single: PyExc_KeyError single: PyExc_KeyboardInterrupt + single: PyExc_LookupError single: PyExc_MemoryError + single: PyExc_ModuleNotFoundError single: PyExc_NameError single: PyExc_NotADirectoryError single: PyExc_NotImplementedError @@ -902,11 +931,19 @@ These are compatibility aliases to :c:data:`PyExc_OSError`: single: PyExc_RecursionError single: PyExc_ReferenceError single: PyExc_RuntimeError + single: PyExc_StopAsyncIteration + single: PyExc_StopIteration single: PyExc_SyntaxError single: PyExc_SystemError single: PyExc_SystemExit + single: PyExc_TabError single: PyExc_TimeoutError single: PyExc_TypeError + single: PyExc_UnboundLocalError + single: PyExc_UnicodeDecodeError + single: PyExc_UnicodeEncodeError + single: PyExc_UnicodeError + single: PyExc_UnicodeTranslateError single: PyExc_ValueError single: PyExc_ZeroDivisionError single: PyExc_EnvironmentError From 0bbadb042f4b0795881929e52d889f4a0463a628 Mon Sep 17 00:00:00 2001 From: cocoatomo Date: Wed, 29 Mar 2017 09:56:15 +0900 Subject: [PATCH 2/7] Insert the Standard Warnings section --- Doc/c-api/exceptions.rst | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index de21653a718813b..f2f10da720ed57e 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -961,3 +961,58 @@ Notes: (3) Only defined on Windows; protect code that uses this by testing that the preprocessor macro ``MS_WINDOWS`` is defined. + +Standard Warnings +================= + +All standard Python warning categories are available as global variables whose +names are ``PyExc_`` followed by the Python exception name. These have the type +:c:type:`PyObject\*`; they are all class objects. For completeness, here are all +the variables: + ++------------------------------------------+---------------------------------+----------+ +| C Name | Python Name | Notes | ++==========================================+=================================+==========+ +| :c:data:`PyExc_BytesWarning` | :exc:`BytesWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_DeprecationWarning` | :exc:`DeprecationWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_FutureWarning` | :exc:`FutureWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_ImportWarning` | :exc:`ImportWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_PendingDepricationWarning`| :exc:`PendingDeprecationWarning`| | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_ResourceWarning` | :exc:`ResourceWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_RuntimeWarning` | :exc:`RuntimeWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_SyntaxWarning` | :exc:`SyntaxWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UnicodeWarning` | :exc:`UnicodeWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UserWarning` | :exc:`UserWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_Warning` | :exc:`Warning` | \(1) | ++------------------------------------------+---------------------------------+----------+ + +.. versionadded:: 3.2 + :c:data:`PyExc_ResourceWarning`. + +.. index:: + single: PyExc_BytesWarning + single: PyExc_DepricationWarning + single: PyExc_FutureWarning + single: PyExc_ImportWarning + single: PyExc_PendingDeprecationWarning + single: PyExc_ResourceWarning + single: PyExc_RuntimeWarning + single: PyExc_SyntaxWarning + single: PyExc_UnicodeWarning + single: PyExc_UserWarning + single: PyExc_Warning + +Notes: + +(1) + This is a base class for other standard exceptions. From d86bff005f12fb9cc877d237b2f6051e90ff748d Mon Sep 17 00:00:00 2001 From: cocoatomo Date: Wed, 29 Mar 2017 10:24:34 +0900 Subject: [PATCH 3/7] Register myself on Misc/ACKS --- Misc/ACKS | 1 + 1 file changed, 1 insertion(+) diff --git a/Misc/ACKS b/Misc/ACKS index 2056efe8fb03624..819829160a01968 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -777,6 +777,7 @@ Jason Killen Jan Kim Taek Joo Kim Sam Kimbrel +Tomohiko Kinebuchi James King W. Trevor King Paul Kippes From a66ceacdafffae5bf75505108f80a79637392164 Mon Sep 17 00:00:00 2001 From: cocoatomo Date: Wed, 29 Mar 2017 10:31:58 +0900 Subject: [PATCH 4/7] Delete trailing whitespaces --- Doc/c-api/exceptions.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index f2f10da720ed57e..83bcfba89b09a80 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -964,12 +964,12 @@ Notes: Standard Warnings ================= - + All standard Python warning categories are available as global variables whose names are ``PyExc_`` followed by the Python exception name. These have the type :c:type:`PyObject\*`; they are all class objects. For completeness, here are all the variables: - + +------------------------------------------+---------------------------------+----------+ | C Name | Python Name | Notes | +==========================================+=================================+==========+ @@ -995,7 +995,7 @@ the variables: +------------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_Warning` | :exc:`Warning` | \(1) | +------------------------------------------+---------------------------------+----------+ - + .. versionadded:: 3.2 :c:data:`PyExc_ResourceWarning`. From 09cd3ed3bb033791b89188a84643de6cd0bb3530 Mon Sep 17 00:00:00 2001 From: cocoatomo Date: Thu, 30 Mar 2017 01:46:13 +0900 Subject: [PATCH 5/7] Improve the sentence and ordering of table entries --- Doc/c-api/exceptions.rst | 236 ++++++++++++++------------------------- 1 file changed, 82 insertions(+), 154 deletions(-) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 83bcfba89b09a80..64e64b5f88f09d0 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -753,111 +753,111 @@ the variables: +-----------------------------------------+---------------------------------+----------+ | C Name | Python Name | Notes | +=========================================+=================================+==========+ -| :c:data:`PyExc_ArithmeticError` | :exc:`ArithmeticError` | \(1) | +| .. c:var:: PyExc_BaseException | :exc:`BaseException` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_AssertionError` | :exc:`AssertionError` | | +| .. c:var:: PyExc_Exception | :exc:`Exception` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_AttributeError` | :exc:`AttributeError` | | +| .. c:var:: PyExc_ArithmeticError | :exc:`ArithmeticError` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_BaseException` | :exc:`BaseException` | \(1) | +| .. c:var:: PyExc_AssertionError | :exc:`AssertionError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_BlockingIOError` | :exc:`BlockingIOError` | | +| .. c:var:: PyExc_AttributeError | :exc:`AttributeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_BrokenPipeError` | :exc:`BrokenPipeError` | | +| .. c:var:: PyExc_BlockingIOError | :exc:`BlockingIOError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_BufferError` | :exc:`BufferError` | | +| .. c:var:: PyExc_BrokenPipeError | :exc:`BrokenPipeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ChildProcessError` | :exc:`ChildProcessError` | | +| .. c:var:: PyExc_BufferError | :exc:`BufferError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ConnectionAbortedError` | :exc:`ConnectionAbortedError` | | +| .. c:var:: PyExc_ChildProcessError | :exc:`ChildProcessError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ConnectionError` | :exc:`ConnectionError` | | +| .. c:var:: PyExc_ConnectionAbortedError | :exc:`ConnectionAbortedError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ConnectionRefusedError` | :exc:`ConnectionRefusedError` | | +| .. c:var:: PyExc_ConnectionError | :exc:`ConnectionError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ConnectionResetError` | :exc:`ConnectionResetError` | | +| .. c:var:: PyExc_ConnectionRefusedError | :exc:`ConnectionRefusedError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_EOFError` | :exc:`EOFError` | | +| .. c:var:: PyExc_ConnectionResetError | :exc:`ConnectionResetError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_Exception` | :exc:`Exception` | \(1) | +| .. c:var:: PyExc_EOFError | :exc:`EOFError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_FileExistsError` | :exc:`FileExistsError` | | +| .. c:var:: PyExc_FileExistsError | :exc:`FileExistsError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_FileNotFoundError` | :exc:`FileNotFoundError` | | +| .. c:var:: PyExc_FileNotFoundError | :exc:`FileNotFoundError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_FloatingPointError` | :exc:`FloatingPointError` | | +| .. c:var:: PyExc_FloatingPointError | :exc:`FloatingPointError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_GeneratorExit` | :exc:`GeneratorExit` | | +| .. c:var:: PyExc_GeneratorExit | :exc:`GeneratorExit` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ImportError` | :exc:`ImportError` | | +| .. c:var:: PyExc_ImportError | :exc:`ImportError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_IndentationError` | :exc:`IndentationError` | | +| .. c:var:: PyExc_IndentationError | :exc:`IndentationError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_IndexError` | :exc:`IndexError` | | +| .. c:var:: PyExc_IndexError | :exc:`IndexError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_InterruptedError` | :exc:`InterruptedError` | | +| .. c:var:: PyExc_InterruptedError | :exc:`InterruptedError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_IsADirectoryError` | :exc:`IsADirectoryError` | | +| .. c:var:: PyExc_IsADirectoryError | :exc:`IsADirectoryError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_KeyError` | :exc:`KeyError` | | +| .. c:var:: PyExc_KeyError | :exc:`KeyError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_KeyboardInterrupt` | :exc:`KeyboardInterrupt` | | +| .. c:var:: PyExc_KeyboardInterrupt | :exc:`KeyboardInterrupt` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_LookupError` | :exc:`LookupError` | \(1) | +| .. c:var:: PyExc_LookupError | :exc:`LookupError` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_MemoryError` | :exc:`MemoryError` | | +| .. c:var:: PyExc_MemoryError | :exc:`MemoryError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ModuleNotFoundError` | :exc:`ModuleNotFoundError` | | +| .. c:var:: PyExc_ModuleNotFoundError | :exc:`ModuleNotFoundError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_NameError` | :exc:`NameError` | | +| .. c:var:: PyExc_NameError | :exc:`NameError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_NotADirectoryError` | :exc:`NotADirectoryError` | | +| .. c:var:: PyExc_NotADirectoryError | :exc:`NotADirectoryError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_NotImplementedError` | :exc:`NotImplementedError` | | +| .. c:var:: PyExc_NotImplementedError | :exc:`NotImplementedError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_OSError` | :exc:`OSError` | \(1) | +| .. c:var:: PyExc_OSError | :exc:`OSError` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_OverflowError` | :exc:`OverflowError` | | +| .. c:var:: PyExc_OverflowError | :exc:`OverflowError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_PermissionError` | :exc:`PermissionError` | | +| .. c:var:: PyExc_PermissionError | :exc:`PermissionError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ProcessLookupError` | :exc:`ProcessLookupError` | | +| .. c:var:: PyExc_ProcessLookupError | :exc:`ProcessLookupError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_RecursionError` | :exc:`RecursionError` | | +| .. c:var:: PyExc_RecursionError | :exc:`RecursionError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ReferenceError` | :exc:`ReferenceError` | \(2) | +| .. c:var:: PyExc_ReferenceError | :exc:`ReferenceError` | \(2) | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_RuntimeError` | :exc:`RuntimeError` | | +| .. c:var:: PyExc_RuntimeError | :exc:`RuntimeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_StopAsyncIteration` | :exc:`StopAsyncIteration` | | +| .. c:var:: PyExc_StopAsyncIteration | :exc:`StopAsyncIteration` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_StopIteration` | :exc:`StopIteration` | | +| .. c:var:: PyExc_StopIteration | :exc:`StopIteration` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_SyntaxError` | :exc:`SyntaxError` | | +| .. c:var:: PyExc_SyntaxError | :exc:`SyntaxError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_SystemError` | :exc:`SystemError` | | +| .. c:var:: PyExc_SystemError | :exc:`SystemError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_SystemExit` | :exc:`SystemExit` | | +| .. c:var:: PyExc_SystemExit | :exc:`SystemExit` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_TabError` | :exc:`TabError` | | +| .. c:var:: PyExc_TabError | :exc:`TabError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_TimeoutError` | :exc:`TimeoutError` | | +| .. c:var:: PyExc_TimeoutError | :exc:`TimeoutError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_TypeError` | :exc:`TypeError` | | +| .. c:var:: PyExc_TypeError | :exc:`TypeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_UnboundLocalError` | :exc:`UnboundLocalError` | | +| .. c:var:: PyExc_UnboundLocalError | :exc:`UnboundLocalError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_UnicodeDecodeError` | :exc:`UnicodeDecodeError` | | +| .. c:var:: PyExc_UnicodeDecodeError | :exc:`UnicodeDecodeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_UnicodeEncodeError` | :exc:`UnicodeEncodeError` | | +| .. c:var:: PyExc_UnicodeEncodeError | :exc:`UnicodeEncodeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_UnicodeError` | :exc:`UnicodeError` | | +| .. c:var:: PyExc_UnicodeError | :exc:`UnicodeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_UnicodeTranslateError` | :exc:`UnicodeTranslateError` | | +| .. c:var:: PyExc_UnicodeTranslateError | :exc:`UnicodeTranslateError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ValueError` | :exc:`ValueError` | | +| .. c:var:: PyExc_ValueError | :exc:`ValueError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ZeroDivisionError` | :exc:`ZeroDivisionError` | | +| .. c:var:: PyExc_ZeroDivisionError | :exc:`ZeroDivisionError` | | +-----------------------------------------+---------------------------------+----------+ .. versionadded:: 3.3 @@ -881,75 +881,16 @@ These are compatibility aliases to :c:data:`PyExc_OSError`: +-------------------------------------+----------+ | C Name | Notes | +=====================================+==========+ -| :c:data:`PyExc_EnvironmentError` | | +| .. c:var:: PyExc_EnvironmentError | | +-------------------------------------+----------+ -| :c:data:`PyExc_IOError` | | +| .. c:var:: PyExc_IOError | | +-------------------------------------+----------+ -| :c:data:`PyExc_WindowsError` | \(3) | +| .. c:var:: PyExc_WindowsError | \(3) | +-------------------------------------+----------+ .. versionchanged:: 3.3 These aliases used to be separate exception types. - -.. index:: - single: PyExc_ArithmeticError - single: PyExc_AssertionError - single: PyExc_AttributeError - single: PyExc_BaseException - single: PyExc_BlockingIOError - single: PyExc_BrokenPipeError - single: PyExc_BufferError - single: PyExc_ChildProcessError - single: PyExc_ConnectionAbortedError - single: PyExc_ConnectionError - single: PyExc_ConnectionRefusedError - single: PyExc_ConnectionResetError - single: PyExc_EOFError - single: PyExc_Exception - single: PyExc_FileExistsError - single: PyExc_FileNotFoundError - single: PyExc_FloatingPointError - single: PyExc_GeneratorExit - single: PyExc_ImportError - single: PyExc_IndentationError - single: PyExc_IndexError - single: PyExc_InterruptedError - single: PyExc_IsADirectoryError - single: PyExc_KeyError - single: PyExc_KeyboardInterrupt - single: PyExc_LookupError - single: PyExc_MemoryError - single: PyExc_ModuleNotFoundError - single: PyExc_NameError - single: PyExc_NotADirectoryError - single: PyExc_NotImplementedError - single: PyExc_OSError - single: PyExc_OverflowError - single: PyExc_PermissionError - single: PyExc_ProcessLookupError - single: PyExc_RecursionError - single: PyExc_ReferenceError - single: PyExc_RuntimeError - single: PyExc_StopAsyncIteration - single: PyExc_StopIteration - single: PyExc_SyntaxError - single: PyExc_SystemError - single: PyExc_SystemExit - single: PyExc_TabError - single: PyExc_TimeoutError - single: PyExc_TypeError - single: PyExc_UnboundLocalError - single: PyExc_UnicodeDecodeError - single: PyExc_UnicodeEncodeError - single: PyExc_UnicodeError - single: PyExc_UnicodeTranslateError - single: PyExc_ValueError - single: PyExc_ZeroDivisionError - single: PyExc_EnvironmentError - single: PyExc_IOError - single: PyExc_WindowsError - Notes: (1) @@ -970,49 +911,36 @@ names are ``PyExc_`` followed by the Python exception name. These have the type :c:type:`PyObject\*`; they are all class objects. For completeness, here are all the variables: -+------------------------------------------+---------------------------------+----------+ -| C Name | Python Name | Notes | -+==========================================+=================================+==========+ -| :c:data:`PyExc_BytesWarning` | :exc:`BytesWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_DeprecationWarning` | :exc:`DeprecationWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_FutureWarning` | :exc:`FutureWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ImportWarning` | :exc:`ImportWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_PendingDepricationWarning`| :exc:`PendingDeprecationWarning`| | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_ResourceWarning` | :exc:`ResourceWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_RuntimeWarning` | :exc:`RuntimeWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_SyntaxWarning` | :exc:`SyntaxWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_UnicodeWarning` | :exc:`UnicodeWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_UserWarning` | :exc:`UserWarning` | | -+------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_Warning` | :exc:`Warning` | \(1) | -+------------------------------------------+---------------------------------+----------+ ++--------------------------------------------+---------------------------------+----------+ +| C Name | Python Name | Notes | ++============================================+=================================+==========+ +| .. c:var:: PyExc_Warning | :exc:`Warning` | \(1) | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_BytesWarning | :exc:`BytesWarning` | | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_DeprecationWarning | :exc:`DeprecationWarning` | | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_FutureWarning | :exc:`FutureWarning` | | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_ImportWarning | :exc:`ImportWarning` | | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_PendingDepricationWarning | :exc:`PendingDeprecationWarning`| | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_ResourceWarning | :exc:`ResourceWarning` | | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_RuntimeWarning | :exc:`RuntimeWarning` | | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_SyntaxWarning | :exc:`SyntaxWarning` | | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_UnicodeWarning | :exc:`UnicodeWarning` | | ++--------------------------------------------+---------------------------------+----------+ +| .. c:var:: PyExc_UserWarning | :exc:`UserWarning` | | ++--------------------------------------------+---------------------------------+----------+ .. versionadded:: 3.2 :c:data:`PyExc_ResourceWarning`. -.. index:: - single: PyExc_BytesWarning - single: PyExc_DepricationWarning - single: PyExc_FutureWarning - single: PyExc_ImportWarning - single: PyExc_PendingDeprecationWarning - single: PyExc_ResourceWarning - single: PyExc_RuntimeWarning - single: PyExc_SyntaxWarning - single: PyExc_UnicodeWarning - single: PyExc_UserWarning - single: PyExc_Warning - Notes: (1) - This is a base class for other standard exceptions. + This is a base class for other standard warning categories. From a0e3bb76ab6cbb55396fcc885e8809830d06678a Mon Sep 17 00:00:00 2001 From: cocoatomo Date: Thu, 30 Mar 2017 10:18:44 +0900 Subject: [PATCH 6/7] Avoid consuming two lines per one exception name --- Doc/c-api/exceptions.rst | 235 +++++++++++++++++++++++++-------------- 1 file changed, 154 insertions(+), 81 deletions(-) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 64e64b5f88f09d0..747f4805e9dd699 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -750,114 +750,169 @@ All standard Python exceptions are available as global variables whose names are :c:type:`PyObject\*`; they are all class objects. For completeness, here are all the variables: +.. index:: + single: PyExc_ArithmeticError + single: PyExc_AssertionError + single: PyExc_AttributeError + single: PyExc_BaseException + single: PyExc_BlockingIOError + single: PyExc_BrokenPipeError + single: PyExc_BufferError + single: PyExc_ChildProcessError + single: PyExc_ConnectionAbortedError + single: PyExc_ConnectionError + single: PyExc_ConnectionRefusedError + single: PyExc_ConnectionResetError + single: PyExc_EOFError + single: PyExc_Exception + single: PyExc_FileExistsError + single: PyExc_FileNotFoundError + single: PyExc_FloatingPointError + single: PyExc_GeneratorExit + single: PyExc_ImportError + single: PyExc_IndentationError + single: PyExc_IndexError + single: PyExc_InterruptedError + single: PyExc_IsADirectoryError + single: PyExc_KeyError + single: PyExc_KeyboardInterrupt + single: PyExc_LookupError + single: PyExc_MemoryError + single: PyExc_ModuleNotFoundError + single: PyExc_NameError + single: PyExc_NotADirectoryError + single: PyExc_NotImplementedError + single: PyExc_OSError + single: PyExc_OverflowError + single: PyExc_PermissionError + single: PyExc_ProcessLookupError + single: PyExc_RecursionError + single: PyExc_ReferenceError + single: PyExc_RuntimeError + single: PyExc_StopAsyncIteration + single: PyExc_StopIteration + single: PyExc_SyntaxError + single: PyExc_SystemError + single: PyExc_SystemExit + single: PyExc_TabError + single: PyExc_TimeoutError + single: PyExc_TypeError + single: PyExc_UnboundLocalError + single: PyExc_UnicodeDecodeError + single: PyExc_UnicodeEncodeError + single: PyExc_UnicodeError + single: PyExc_UnicodeTranslateError + single: PyExc_ValueError + single: PyExc_ZeroDivisionError + +-----------------------------------------+---------------------------------+----------+ | C Name | Python Name | Notes | +=========================================+=================================+==========+ -| .. c:var:: PyExc_BaseException | :exc:`BaseException` | \(1) | +| :c:data:`PyExc_ArithmeticError` | :exc:`ArithmeticError` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_Exception | :exc:`Exception` | \(1) | +| :c:data:`PyExc_AssertionError` | :exc:`AssertionError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ArithmeticError | :exc:`ArithmeticError` | \(1) | +| :c:data:`PyExc_AttributeError` | :exc:`AttributeError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_AssertionError | :exc:`AssertionError` | | +| :c:data:`PyExc_BaseException` | :exc:`BaseException` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_AttributeError | :exc:`AttributeError` | | +| :c:data:`PyExc_BlockingIOError` | :exc:`BlockingIOError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_BlockingIOError | :exc:`BlockingIOError` | | +| :c:data:`PyExc_BrokenPipeError` | :exc:`BrokenPipeError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_BrokenPipeError | :exc:`BrokenPipeError` | | +| :c:data:`PyExc_BufferError` | :exc:`BufferError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_BufferError | :exc:`BufferError` | | +| :c:data:`PyExc_ChildProcessError` | :exc:`ChildProcessError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ChildProcessError | :exc:`ChildProcessError` | | +| :c:data:`PyExc_ConnectionAbortedError` | :exc:`ConnectionAbortedError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ConnectionAbortedError | :exc:`ConnectionAbortedError` | | +| :c:data:`PyExc_ConnectionError` | :exc:`ConnectionError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ConnectionError | :exc:`ConnectionError` | | +| :c:data:`PyExc_ConnectionRefusedError` | :exc:`ConnectionRefusedError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ConnectionRefusedError | :exc:`ConnectionRefusedError` | | +| :c:data:`PyExc_ConnectionResetError` | :exc:`ConnectionResetError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ConnectionResetError | :exc:`ConnectionResetError` | | +| :c:data:`PyExc_EOFError` | :exc:`EOFError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_EOFError | :exc:`EOFError` | | +| :c:data:`PyExc_Exception` | :exc:`Exception` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_FileExistsError | :exc:`FileExistsError` | | +| :c:data:`PyExc_FileExistsError` | :exc:`FileExistsError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_FileNotFoundError | :exc:`FileNotFoundError` | | +| :c:data:`PyExc_FileNotFoundError` | :exc:`FileNotFoundError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_FloatingPointError | :exc:`FloatingPointError` | | +| :c:data:`PyExc_FloatingPointError` | :exc:`FloatingPointError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_GeneratorExit | :exc:`GeneratorExit` | | +| :c:data:`PyExc_GeneratorExit` | :exc:`GeneratorExit` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ImportError | :exc:`ImportError` | | +| :c:data:`PyExc_ImportError` | :exc:`ImportError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_IndentationError | :exc:`IndentationError` | | +| :c:data:`PyExc_IndentationError` | :exc:`IndentationError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_IndexError | :exc:`IndexError` | | +| :c:data:`PyExc_IndexError` | :exc:`IndexError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_InterruptedError | :exc:`InterruptedError` | | +| :c:data:`PyExc_InterruptedError` | :exc:`InterruptedError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_IsADirectoryError | :exc:`IsADirectoryError` | | +| :c:data:`PyExc_IsADirectoryError` | :exc:`IsADirectoryError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_KeyError | :exc:`KeyError` | | +| :c:data:`PyExc_KeyError` | :exc:`KeyError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_KeyboardInterrupt | :exc:`KeyboardInterrupt` | | +| :c:data:`PyExc_KeyboardInterrupt` | :exc:`KeyboardInterrupt` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_LookupError | :exc:`LookupError` | \(1) | +| :c:data:`PyExc_LookupError` | :exc:`LookupError` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_MemoryError | :exc:`MemoryError` | | +| :c:data:`PyExc_MemoryError` | :exc:`MemoryError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ModuleNotFoundError | :exc:`ModuleNotFoundError` | | +| :c:data:`PyExc_ModuleNotFoundError` | :exc:`ModuleNotFoundError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_NameError | :exc:`NameError` | | +| :c:data:`PyExc_NameError` | :exc:`NameError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_NotADirectoryError | :exc:`NotADirectoryError` | | +| :c:data:`PyExc_NotADirectoryError` | :exc:`NotADirectoryError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_NotImplementedError | :exc:`NotImplementedError` | | +| :c:data:`PyExc_NotImplementedError` | :exc:`NotImplementedError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_OSError | :exc:`OSError` | \(1) | +| :c:data:`PyExc_OSError` | :exc:`OSError` | \(1) | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_OverflowError | :exc:`OverflowError` | | +| :c:data:`PyExc_OverflowError` | :exc:`OverflowError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_PermissionError | :exc:`PermissionError` | | +| :c:data:`PyExc_PermissionError` | :exc:`PermissionError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ProcessLookupError | :exc:`ProcessLookupError` | | +| :c:data:`PyExc_ProcessLookupError` | :exc:`ProcessLookupError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_RecursionError | :exc:`RecursionError` | | +| :c:data:`PyExc_RecursionError` | :exc:`RecursionError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ReferenceError | :exc:`ReferenceError` | \(2) | +| :c:data:`PyExc_ReferenceError` | :exc:`ReferenceError` | \(2) | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_RuntimeError | :exc:`RuntimeError` | | +| :c:data:`PyExc_RuntimeError` | :exc:`RuntimeError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_StopAsyncIteration | :exc:`StopAsyncIteration` | | +| :c:data:`PyExc_StopAsyncIteration` | :exc:`StopAsyncIteration` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_StopIteration | :exc:`StopIteration` | | +| :c:data:`PyExc_StopIteration` | :exc:`StopIteration` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_SyntaxError | :exc:`SyntaxError` | | +| :c:data:`PyExc_SyntaxError` | :exc:`SyntaxError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_SystemError | :exc:`SystemError` | | +| :c:data:`PyExc_SystemError` | :exc:`SystemError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_SystemExit | :exc:`SystemExit` | | +| :c:data:`PyExc_SystemExit` | :exc:`SystemExit` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_TabError | :exc:`TabError` | | +| :c:data:`PyExc_TabError` | :exc:`TabError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_TimeoutError | :exc:`TimeoutError` | | +| :c:data:`PyExc_TimeoutError` | :exc:`TimeoutError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_TypeError | :exc:`TypeError` | | +| :c:data:`PyExc_TypeError` | :exc:`TypeError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_UnboundLocalError | :exc:`UnboundLocalError` | | +| :c:data:`PyExc_UnboundLocalError` | :exc:`UnboundLocalError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_UnicodeDecodeError | :exc:`UnicodeDecodeError` | | +| :c:data:`PyExc_UnicodeDecodeError` | :exc:`UnicodeDecodeError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_UnicodeEncodeError | :exc:`UnicodeEncodeError` | | +| :c:data:`PyExc_UnicodeEncodeError` | :exc:`UnicodeEncodeError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_UnicodeError | :exc:`UnicodeError` | | +| :c:data:`PyExc_UnicodeError` | :exc:`UnicodeError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_UnicodeTranslateError | :exc:`UnicodeTranslateError` | | +| :c:data:`PyExc_UnicodeTranslateError` | :exc:`UnicodeTranslateError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ValueError | :exc:`ValueError` | | +| :c:data:`PyExc_ValueError` | :exc:`ValueError` | | +-----------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ZeroDivisionError | :exc:`ZeroDivisionError` | | +| :c:data:`PyExc_ZeroDivisionError` | :exc:`ZeroDivisionError` | | +-----------------------------------------+---------------------------------+----------+ .. versionadded:: 3.3 @@ -878,14 +933,19 @@ the variables: These are compatibility aliases to :c:data:`PyExc_OSError`: +.. index:: + single: PyExc_EnvironmentError + single: PyExc_IOError + single: PyExc_WindowsError + +-------------------------------------+----------+ | C Name | Notes | +=====================================+==========+ -| .. c:var:: PyExc_EnvironmentError | | +| :c:data:`PyExc_EnvironmentError` | | +-------------------------------------+----------+ -| .. c:var:: PyExc_IOError | | +| :c:data:`PyExc_IOError` | | +-------------------------------------+----------+ -| .. c:var:: PyExc_WindowsError | \(3) | +| :c:data:`PyExc_WindowsError` | \(3) | +-------------------------------------+----------+ .. versionchanged:: 3.3 @@ -911,31 +971,44 @@ names are ``PyExc_`` followed by the Python exception name. These have the type :c:type:`PyObject\*`; they are all class objects. For completeness, here are all the variables: -+--------------------------------------------+---------------------------------+----------+ -| C Name | Python Name | Notes | -+============================================+=================================+==========+ -| .. c:var:: PyExc_Warning | :exc:`Warning` | \(1) | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_BytesWarning | :exc:`BytesWarning` | | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_DeprecationWarning | :exc:`DeprecationWarning` | | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_FutureWarning | :exc:`FutureWarning` | | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ImportWarning | :exc:`ImportWarning` | | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_PendingDepricationWarning | :exc:`PendingDeprecationWarning`| | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_ResourceWarning | :exc:`ResourceWarning` | | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_RuntimeWarning | :exc:`RuntimeWarning` | | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_SyntaxWarning | :exc:`SyntaxWarning` | | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_UnicodeWarning | :exc:`UnicodeWarning` | | -+--------------------------------------------+---------------------------------+----------+ -| .. c:var:: PyExc_UserWarning | :exc:`UserWarning` | | -+--------------------------------------------+---------------------------------+----------+ +.. index:: + single: PyExc_BytesWarning + single: PyExc_DepricationWarning + single: PyExc_FutureWarning + single: PyExc_ImportWarning + single: PyExc_PendingDeprecationWarning + single: PyExc_ResourceWarning + single: PyExc_RuntimeWarning + single: PyExc_SyntaxWarning + single: PyExc_UnicodeWarning + single: PyExc_UserWarning + single: PyExc_Warning + ++------------------------------------------+---------------------------------+----------+ +| C Name | Python Name | Notes | ++==========================================+=================================+==========+ +| :c:data:`PyExc_BytesWarning` | :exc:`BytesWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_DeprecationWarning` | :exc:`DeprecationWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_FutureWarning` | :exc:`FutureWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_ImportWarning` | :exc:`ImportWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_PendingDepricationWarning`| :exc:`PendingDeprecationWarning`| | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_ResourceWarning` | :exc:`ResourceWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_RuntimeWarning` | :exc:`RuntimeWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_SyntaxWarning` | :exc:`SyntaxWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UnicodeWarning` | :exc:`UnicodeWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_UserWarning` | :exc:`UserWarning` | | ++------------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_Warning` | :exc:`Warning` | \(1) | ++------------------------------------------+---------------------------------+----------+ .. versionadded:: 3.2 :c:data:`PyExc_ResourceWarning`. From e3d6db3b6145d68ffea5c70384ab5cec91809e5d Mon Sep 17 00:00:00 2001 From: cocoatomo Date: Sun, 2 Apr 2017 07:02:43 +0900 Subject: [PATCH 7/7] Move some common ancestor classes to the top of the tables --- Doc/c-api/exceptions.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 747f4805e9dd699..3516a1690384f73 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -751,10 +751,11 @@ All standard Python exceptions are available as global variables whose names are the variables: .. index:: + single: PyExc_BaseException + single: PyExc_Exception single: PyExc_ArithmeticError single: PyExc_AssertionError single: PyExc_AttributeError - single: PyExc_BaseException single: PyExc_BlockingIOError single: PyExc_BrokenPipeError single: PyExc_BufferError @@ -764,7 +765,6 @@ the variables: single: PyExc_ConnectionRefusedError single: PyExc_ConnectionResetError single: PyExc_EOFError - single: PyExc_Exception single: PyExc_FileExistsError single: PyExc_FileNotFoundError single: PyExc_FloatingPointError @@ -808,14 +808,16 @@ the variables: +-----------------------------------------+---------------------------------+----------+ | C Name | Python Name | Notes | +=========================================+=================================+==========+ +| :c:data:`PyExc_BaseException` | :exc:`BaseException` | \(1) | ++-----------------------------------------+---------------------------------+----------+ +| :c:data:`PyExc_Exception` | :exc:`Exception` | \(1) | ++-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_ArithmeticError` | :exc:`ArithmeticError` | \(1) | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_AssertionError` | :exc:`AssertionError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_AttributeError` | :exc:`AttributeError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_BaseException` | :exc:`BaseException` | \(1) | -+-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_BlockingIOError` | :exc:`BlockingIOError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_BrokenPipeError` | :exc:`BrokenPipeError` | | @@ -834,8 +836,6 @@ the variables: +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_EOFError` | :exc:`EOFError` | | +-----------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_Exception` | :exc:`Exception` | \(1) | -+-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_FileExistsError` | :exc:`FileExistsError` | | +-----------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_FileNotFoundError` | :exc:`FileNotFoundError` | | @@ -972,6 +972,7 @@ names are ``PyExc_`` followed by the Python exception name. These have the type the variables: .. index:: + single: PyExc_Warning single: PyExc_BytesWarning single: PyExc_DepricationWarning single: PyExc_FutureWarning @@ -982,11 +983,12 @@ the variables: single: PyExc_SyntaxWarning single: PyExc_UnicodeWarning single: PyExc_UserWarning - single: PyExc_Warning +------------------------------------------+---------------------------------+----------+ | C Name | Python Name | Notes | +==========================================+=================================+==========+ +| :c:data:`PyExc_Warning` | :exc:`Warning` | \(1) | ++------------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_BytesWarning` | :exc:`BytesWarning` | | +------------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_DeprecationWarning` | :exc:`DeprecationWarning` | | @@ -1007,8 +1009,6 @@ the variables: +------------------------------------------+---------------------------------+----------+ | :c:data:`PyExc_UserWarning` | :exc:`UserWarning` | | +------------------------------------------+---------------------------------+----------+ -| :c:data:`PyExc_Warning` | :exc:`Warning` | \(1) | -+------------------------------------------+---------------------------------+----------+ .. versionadded:: 3.2 :c:data:`PyExc_ResourceWarning`.