title: Python class interface design
body: <p>Is there a way to easily expose the APi of an internal object of a python class without retyping every API of that object? For example, I write a redis replica class and all my functions are like </p>
  
  <pre><code>def get_connection(self, name):
      ........
      host, conn = self.colo_rings[name]
      return conn
  
  def hgetall(self, name):
      return self.get_connection(name).hgetall(name)
  
  def hset(self, name, key, value):
      return self.get_connection(name).hset(name, key, value)
  
  def hsetnx(self, name, key, value):
      return self.get_connection(name).hsetnx(name, key, value)
  
  def hdel(self, name, *key, colo=None):
      return self.get_connection(name).hdel(name, *key)
  </code></pre>
  
  <p>How can I improve this code and make it not that "ugly"?</p>