title: Check if an object (with certain properties values) not in list
body: <p>I am new in Python. I am using Python v2.7.</p>
  
  <p>I have defined a simple class <code>Product</code>:</p>
  
  <pre><code>class Product:
      def __init__(self, price, height, width):
          self.price = price
          self.height = height
          self.width = width
  </code></pre>
  
  <p>Then, I created a list, which is then appended with a <code>Product</code> object:</p>
  
  <pre><code># empty list
  prod_list = []
  # append a product to the list, all properties have value 3
  prod1 = Product(3,3,3)
  prod_list.append(prod1)
  </code></pre>
  
  <p>Then, I created another <code>Product</code> object which is set the same initialize values (all 3):</p>
  
  <pre><code>prod2 = Product(3,3,3)
  </code></pre>
  
  <p>Then, I want to check if <code>prod_list</code> <strong>doesn't</strong> contain a <code>Product</code> object that has price=3, width=3 &amp; height=3, by:</p>
  
  <pre><code>if prod2 not in prod_list:
     print("no product in list has price=3, width=3 &amp; height=3")
  </code></pre>
  
  <p>I expect there is no print out message, but it is printed out. In Python, how can I check if a list doesn't have an object with certain property values then?</p>