def specialClass(cls, prepend=None, append=None, defaults=None, override=None):
 if (prepend is None):
  prepend = []
 if (append is None):
  append = []
 if (defaults is None):
  defaults = {}
 if (override is None):
  override = {}
 class CustomClass(cls, ):
  'Customized subclass with preset args/params'
  def __init__(self, *args, **params):
   newparams = defaults.copy()
   newparams.update(params)
   newparams.update(override)
   cls.__init__(self, *((list(prepend) + list(args)) + list(append)), **newparams)
 CustomClass.__name__ = ('%s%s' % (cls.__name__, defaults))
 return CustomClass

def specialClass ( cls , prepend = None , append = None , defaults = None , override = None ) : if ( prepend is None ) : prepend = [ ] if ( append is None ) : append = [ ] if ( defaults is None ) : defaults = { } if ( override is None ) : override = { } class CustomClass ( cls , ) : def __init__ ( self , * args , ** params ) : newparams = defaults . copy ( ) newparams . update ( params ) newparams . update ( override ) cls . __init__ ( self , * ( ( list ( prepend ) + list ( args ) ) + list ( append ) ) , ** newparams ) CustomClass . __name__ = ( '%s%s' % ( cls . __name__ , defaults ) ) return CustomClass
like functools .