def autodelegate(prefix=''):
 def internal(self, arg):
  func = (prefix + arg)
  if hasattr(self, func):
   return getattr(self, func)()
  else:
   return notfound()
 return internal

def autodelegate ( prefix = '' ) : def internal ( self , arg ) : func = ( prefix + arg ) if hasattr ( self , func ) : return getattr ( self , func ) ( ) else : return notfound ( ) return internal
returns a method that takes one argument and calls the method named prefix+arg .