title: Is there a way to search in an __repr__ similar to a string in Python
body: <p>I'm currently working on a project, and I was hoping to use the __ repr __ method to look directly at a list and see if a value is present.</p>
  
  <p>Currently, my method looks like this:</p>
  
  <pre><code>def __ repr__(self):
       return 'Item({!r},{!r})'.format(self._id_code, self._title)
  </code></pre>
  
  <p>Let's say I have an input of Item("Jerry","123"), then my object, rather than giving the memory address, now looks like this:</p>
  
  <pre><code>Item('Jerry','123')
  </code></pre>
  
  <p>However, when I try to check to see if an input matches it comes back as false. For example:</p>
  
  <pre><code>print('123' in Item('Jerry','123')) # This comes back as False
  </code></pre>
  
  <p>Is there a way to take an __ repr__ and make it a string that I can search over?</p>
  
  <p>Thank you in advance for your insights.</p>