1. 程式人生 > >python 常見的錯誤類型 和 繼承關系

python 常見的錯誤類型 和 繼承關系

code dex dede 運行時 繼承關系 one err 系統 type

BaseException
 +-- SystemExit #系統結束
 +-- KeyboardInterrupt #鍵盤中斷 ctrl+D
 +-- GeneratorExit #主動結束
 +-- Exception #異常
      +-- StopIteration #叠代器錯誤
      +-- StandardError #標準錯誤
      |    +-- BufferError #buff錯誤
      |    +-- ArithmeticError #數學錯誤
      |    |    +-- FloatingPointError #浮點數錯誤
      |    |    +-- OverflowError #溢出
      |    |    +-- ZeroDivisionError #除零
      |    +-- AssertionError #斷言錯誤
      |    +-- AttributeError #屬性錯誤
      |    +-- EnvironmentError #環境錯誤
      |    |    +-- IOError #IO錯誤
      |    |    +-- OSError #操作系統錯誤
      |    |         +-- WindowsError (Windows) #windows錯誤
      |    |         +-- VMSError (VMS) #vms錯誤
      |    +-- EOFError #文件結束符eof錯誤
      |    +-- ImportError #導入錯誤
      |    +-- LookupError #查找錯誤
      |    |    +-- IndexError #下標錯誤
      |    |    +-- KeyError #key值錯誤
      |    +-- MemoryError #內存錯誤
      |    +-- NameError #命名錯誤
      |    |    +-- UnboundLocalError #無邊界位置錯誤
      |    +-- ReferenceError #引用錯誤
      |    +-- RuntimeError #運行時錯誤
      |    |    +-- NotImplementedError #未實現錯誤
      |    +-- SyntaxError #語法錯誤
      |    |    +-- IndentationError #標識符錯誤
      |    |         +-- TabError #tab錯誤
      |    +-- SystemError #系統錯誤
      |    +-- TypeError #類型錯誤
      |    +-- ValueError #值錯誤
      |         +-- UnicodeError #unicode錯誤
      |              +-- UnicodeDecodeError #unicode解碼錯誤
      |              +-- UnicodeEncodeError #unicode編碼錯誤
      |              +-- UnicodeTranslateError #unicode翻譯錯誤
      +-- Warning #警告
           +-- DeprecationWarning #棄用警告
           +-- PendingDeprecationWarning #即將棄用的警告
           +-- RuntimeWarning #運行時警告
           +-- SyntaxWarning #語法警告
           +-- UserWarning #用戶警告
           +-- FutureWarning #功能警告
	   +-- ImportWarning #導入警告
	   +-- UnicodeWarning #unicode警告
	   +-- BytesWarning #字節警告

python 常見的錯誤類型 和 繼承關系