File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,9 @@ may name multiple exceptions as a parenthesized tuple, for example::
119119   ... except (RuntimeError, TypeError, NameError): 
120120   ...     pass 
121121
122- A class in an :keyword: `except ` clause is compatible with an exception if it is 
123- the same  class or a base class thereof  (but not the other way around --- an
124- *except clause * listing a derived class is  not compatible with a  base class ).
122+ A class in an :keyword: `except ` clause matches exceptions which are instances of the 
123+ class itself  or one of its derived classes  (but not the other way around --- an
124+ *except clause * listing a derived class does  not match instances of its  base classes ).
125125For example, the following code will print B, C, D in that order::
126126
127127   class B(Exception): 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments