title: Where to find __repr__ of Python weakref proxy?
body: <p>I am a bit puzzled right now about the following:</p>
  <pre class="lang-py prettyprint-override"><code>import weakref
  
  class A:
      def __init__(self, p):
          self.p = p
          
      def __repr__(self):
          return f&quot;{type(self).__name__}(p={self.p!r})&quot;
      
  a = A(1)
  proxy_a = weakref.proxy(a)
  
  print(repr(proxy_a))
  # '&lt;weakproxy at 0x7f2ea2fc1b80 to A at 0x7f2ea2fee610&gt;'
  print(proxy_a.__repr__())
  # 'A(p=1)'
  </code></pre>
  <p>Why does <code>repr(proxy_a)</code> return a representation of the proxy while <code>proxy_a.__repr__()</code> returns the representation of the original object? Shouldn't the two calls boil down to the same thing? And which <code>__repr__</code> implementation is actually called by using <code>repr(proxy_a)</code>?</p>