title: python2.7: passing kwargs in instance methods
body: <p>If I want to pass an indentical list of args from one function to another, I can use the locals function. However this falls over if I'm in an instance method, as self cannot be passed as kwarg. I can create a dict of locals and then delete self. I was wondering if there's a more elegant way of doing this though - it seems to come up quite a lot for me.</p>
  
  <pre><code>class MyObj:
      def test(self, a=1, b=2, c=3, d=4):
          return [a,b,c,d]
  
  class MyVerboseObj(MyObj):
      def test(self, a=1, b=2, c=3, d=4):
          print "RUNNING TEST a=%d"%a
          kwargs = locals()
          del kwargs["self"]
          return MyObj.test(self, **kwargs)
  
  MyVerboseObj().test()
  </code></pre>
  
  <p>Is there a better way to pass the identical list args from MyVerboseObj.test to MyObj.test?</p>
  
  <p><strong>** UPDATE **</strong></p>
  
  <p>This is a simplified example to demostrate my question. A more practical example might be this:</p>
  
  <pre><code>class GenericShow:
      def __init__(self, path):
          self.path = path
      def getRenderPath(self, extn="jpg", colspace="rgb"):
          return "%s/render_%s.%s"%(self.path, colspace, extn)
      def hasGenericShowHandler(self):
          try:
              import GenericShowHandler
              return True
          except: pass
  
  class UkShow(GenericShow):
       def getRenderPath(self, extn="jpg", colspace="rgb"):
           if self.hasGenericShowHandler():
               kwargs = locals()
               kwargs.pop("self")
               return GenericShow.getRenderPath(self, **kwargs)
           else:
              return "%s/blah/render_%s.%s"%(path, colspace, extn)
  
  show = UkShow("/jobs/test")
  show.hasGenericShowHandler()
  print show.getRenderPath()
  </code></pre>
  
  <p>I have a lot of show objects with different vars defined by different modules and different naming conventions - I'm trying to create show objects with common functionality.</p>