您的位置:首页 > 编程语言 > Python开发

Python常见的错误类型及其继承关系

2017-08-04 11:49 411 查看
Python所有的错误都是从BaseException类派生的。

下面是Python常见的错误类型及其继承关系:

BaseException

+– SystemExit

+– KeyboardInterrupt

+– GeneratorExit

+– Exception

+– StopIteration

+– StopAsyncIteration

+– ArithmeticError

| +– FloatingPointError

| +– OverflowError

| +– ZeroDivisionError

+– AssertionError

+– AttributeError

+– BufferError

+– EOFError

+– ImportError

+– ModuleNotFoundError

+– LookupError

| +– IndexError

| +– KeyError

+– MemoryError

+– NameError

| +– UnboundLocalError

+– OSError

| +– BlockingIOError

| +– ChildProcessError

| +– ConnectionError

| | +– BrokenPipeError

| | +– ConnectionAbortedError

| | +– ConnectionRefusedError

| | +– ConnectionResetError

| +– FileExistsError

| +– FileNotFoundError

| +– InterruptedError

| +– IsADirectoryError

| +– NotADirectoryError

| +– PermissionError

| +– ProcessLookupError

| +– TimeoutError

+– ReferenceError

+– RuntimeError

| +– NotImplementedError

| +– RecursionError

+– SyntaxError

| +– IndentationError

| +– TabError

+– SystemError

+– TypeError

+– ValueError

| +– UnicodeError

| +– UnicodeDecodeError

| +– UnicodeEncodeError

| +– UnicodeTranslateError

+– Warning

+– DeprecationWarning

+– PendingDeprecationWarning

+– RuntimeWarning

+– SyntaxWarning

+– UserWarning

+– FutureWarning

+– ImportWarning

+– UnicodeWarning

+– BytesWarning

+– ResourceWarning
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python 错误类型