Java 企業應用
          不要溫柔的走入那個良夜
          Online Docs
          http://docs.python.org/2.6/library/exceptions.html
          The class hierarchy for built-in exceptions is:

          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
          exception BaseException

          The base class for all built-in exceptions. It is not meant to be directly inherited by user-defined classes (for that use Exception). If str() or unicode() is called on an instance of this class, the representation of the argument(s) to the instance are returned or the empty string when there were no arguments. All arguments are stored in args as a tuple.

          New in version 2.5.

          exception Exception

          All built-in, non-system-exiting exceptions are derived from this class. All user-defined exceptions should also be derived from this class.

          Changed in version 2.5: Changed to inherit from BaseException.

          '''
          Created on Aug 152013
          '''
          class MyException(Exception):
          #     
          """My documentation"""
          class MyException(Exception):
              pass
          class MyException(Exception):
          #     def _get_message(self): 
          #         
          return self.args[0]
          #     def _set_message(self, message): 
          #         self._message 
          = message
          #     message 
          = property(_get_message, _set_message)

          try:
              raise MyException(
          'description1''description2')
          except MyException as my:
              print str(my)
              print unicode(my) 
              
          try:
              raise MyException(u
          'description1', u'description2')
          except MyException as my:
              print str(my)  
              print unicode(my)  
             
          posted on 2013-08-16 10:23 cpegtop 閱讀(370) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
           
          主站蜘蛛池模板: 定州市| 丹阳市| 兴安盟| 尼勒克县| 农安县| 山西省| 高阳县| 阆中市| 石林| 长寿区| 太原市| 宁都县| 兴仁县| 巴塘县| 房山区| 壶关县| 饶河县| 吉安市| 砀山县| 凤凰县| 巨野县| 靖安县| 双城市| 额济纳旗| 通榆县| 武清区| 油尖旺区| 班玛县| 石门县| 吴江市| 牙克石市| 奇台县| 滨州市| 依兰县| 始兴县| 道真| 淮阳县| 和田市| 兖州市| 娄烦县| 富阳市|