title: Custom __str__ and __repr__ are not working
body: <p>I am trying to convert an output such as :</p>
  
  <pre><code>decrypt : &lt;torfuncs.TorHop instance at 0x7f44babb8440&gt;
  </code></pre>
  
  <p>into something a bit more readable, the result should be a string from array. I have defined <code>__str__</code> and <code>__repr__</code> but even with these I am still getting the result above. What am I doing wrong?</p>
  
  <pre><code>class TorCircuit():
      def __init__(self, sock, circid):
          self.hops = []
          self.circId = circid
          self.socket = sock
          self.tempX = 0
          self.packetSendCount = 0
          self.cookie = []
  
      def __str__(self, hop):    
          return 'hop #%d' %  self.hops
  
      def __repr__(self, hop):
          return 'hop #%d' %  self.hops
  
      def decrypt(self, relayCell):
          for hop in self.hops:
              print "decrypt :", str(hop)
              relayCell = hop.decrypt(relayCell)
              if relayCell[1]==0 and relayCell[2]==0:
                  return relayCell
          return relayCell
  </code></pre>
  
  <p>What I am trying to print out is the hop currently in use for the decryption </p>
  
  <p>edit TorHop</p>
  
  <pre><code>class TorHop:
  
      def __str__(self):    
          return 'hop #' %  self.hop
  
      def __repr__(self):
          return 'hop #' %  self.hop
  
      def __init__(self, KH, Df, Db, Kf, Kb):
          self.KH = KH
          self.Df = Df
          self.Db = Db
          self.Kf = Kf
          self.Kb = Kb
  
          self.fwdSha = SHA.new()
          self.fwdSha.update(Df)
          self.bwdSha = SHA.new()
          self.bwdSha.update(Db)
  
          ctr = Counter.new(128,initial_value=0)
          self.fwdCipher = AES.new(Kf, AES.MODE_CTR, counter=ctr)
          ctr = Counter.new(128,initial_value=0)
          self.bwdCipher = AES.new(Kb, AES.MODE_CTR, counter=ctr)
      def encrypt(self, data):
          return self.fwdCipher.encrypt(data)
      def decrypt(self, data):
          return self.bwdCipher.decrypt(data)
  </code></pre>
  
  <p>with this I now get:</p>
  
  <pre><code>AttributeError: TorHop instance has no attribute 'hops'
  </code></pre>