[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

base-class call decorator

Aaron Brady

3/12/2008 6:02:00 AM

If you had this,

class KType( BaseType ):
def __init__( self, *ar, **kwar ):
self.setProp= True
BaseType.__init__( self, *ar, **kwar )

a lot, and wanted a decorator, what would it be? What are the pros
and cons?

class KType( BaseType ):
@basecall
def __init__( self ):
self.setProp= True

What about calling first vs. last, base class order, certain bases,
etc.? When is it easier to do without?