title: winpdb: how Repr works?
body: <p>I've got a UserDict class with redefined <code>__repr__</code> and <code>__str__</code> and I'm debugging some code using it with WinPDB:</p>
  
  <pre><code>class UserDict(dict):
      def __repr__(self):
          return "this is repr"
      def __str__(self):
         return "this is str"
  
  variable = UserDict()
  variable["abc"] = 1
  </code></pre>
  
  <p>Here is a debugging session of that script. Note 2 commands in console: <code>eval(variable)</code> and <code>eval(variable.__repr__())</code>, issued, when the execution of the script reached the last line:
  <img src="https://i.stack.imgur.com/hq4eZ.png" alt="enter image description here"></p>
  
  <p>If I say <code>eval(variable)</code> in WinPDB console, which should fail in a normal python console, it returns the same as in its "Repr" column. </p>
  
  <p>I wonder, how it fills the contents of that "Repr" column and what it really does, when I say <code>eval(variable)</code>?</p>