Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.os.vms    |    DEC's VAX* line of computers & VMS.    |    264,096 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 262,846 of 264,096    |
|    Lawrence D'Oliveiro to All    |
|    Re: VMS x86-64 database server    |
|    11 Jul 25 02:54:36    |
   
   From: ldo@nz.invalid   
      
   On Thu, 10 Jul 2025 20:38:29 -0400, Arne Vajhøj wrote:   
      
   > The ability to subclass exceptions to catch specific and the ability   
   > to rethrow exceptions are quite common. Not Python specific at all.   
   >   
   > Java use sub-classing extensively for database. A little simplified:   
   >   
   > |->SQLNonTransientException->non transient exception classses   
   > SQLException-|   
   > |->SQLTransientException->transient exception classses   
   >   
      
   Python has metaclasses. These make it easy to set up an exception   
   hierarchy based on status codes (or other criteria). A subclass   
   definition can be as simple as   
      
    class HangupNetworkTrouble(HangupCause) :   
    _CODES_ = {2, 3, 38, 42}   
    #end HangupNetworkTrouble   
      
   Now if the status code is one of those listed, any instantiation of   
   the base class will automatically delegate to this subclass.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca