Java 企業(yè)應(yīng)用
          不要溫柔的走入那個(gè)良夜
          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 閱讀(371) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
           
          主站蜘蛛池模板: 柳江县| 广西| 五家渠市| 九龙城区| 孝昌县| 济南市| 阿城市| 镇赉县| 无锡市| 稻城县| 克山县| 连城县| 秦皇岛市| 鱼台县| 观塘区| 昔阳县| 潜山县| 无棣县| 景德镇市| 文成县| 阳西县| 长葛市| 赤壁市| 乐亭县| 平凉市| 河南省| 中阳县| 定结县| 屏山县| 南靖县| 宁陕县| 湖口县| 攀枝花市| 奉新县| 古丈县| 四子王旗| 肇庆市| 英德市| 连山| 同仁县| 元氏县|