zoukankan      html  css  js  c++  java
  • Python2.7-内置异常类型

    python内置了许多异常类型,他们的继承关系如下:
    -----------------------------------------------
    BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception +-- StopIteration +-- StandardError | +-- BufferError | +-- ArithmeticError | | +-- FloatingPointError | | +-- OverflowError | | +-- ZeroDivisionError | +-- AssertionError | +-- AttributeError | +-- EnvironmentError | | +-- IOError | | +-- OSError | | +-- WindowsError (Windows) | | +-- VMSError (VMS) | +-- EOFError | +-- ImportError | +-- LookupError | | +-- IndexError | | +-- KeyError | +-- MemoryError | +-- NameError | | +-- UnboundLocalError | +-- ReferenceError | +-- RuntimeError | | +-- NotImplementedError | +-- SyntaxError | | +-- IndentationError | | +-- TabError | +-- SystemError | +-- TypeError | +-- ValueError | +-- UnicodeError | +-- UnicodeDecodeError | +-- UnicodeEncodeError | +-- UnicodeTranslateError +-- Warning +-- DeprecationWarning +-- PendingDeprecationWarning +-- RuntimeWarning +-- SyntaxWarning +-- UserWarning +-- FutureWarning +-- ImportWarning +-- UnicodeWarning +-- BytesWarning
    -------------------------------------------------
    一般在自己编写程序的时候需要注意的就是
    TypeError、ValueError
    在编写继承关系的类时,定义基类的需要被子类覆盖的方法时要注意NotImplementedError
    -------------------------------------------------
    原文链接:https://docs.python.org/2/library/exceptions.html
    ---------------- 坚持每天学习一点点
  • 相关阅读:
    Wix 教程
    SQL插入數據變成?解決辦法
    DevExpress GridControl使用方法总结【轉】
    Javascript如何判断对象是否相等【轉】
    android StringBuffer类的使用
    Linux命令
    PHP解决中文乱码
    PHP防盗链技术
    0113进度条+ListView+ArrayList+Adapter用法
    Windows中32位(x86)和64位(x64)解释
  • 原文地址:https://www.cnblogs.com/tccbj/p/7581433.html
Copyright © 2011-2022 走看看