title: Check if object attributes are non-empty python
body: <p>I can check if python list or dictionary are empty or not like this</p>
  
  <pre><code>lis1, dict1 = [], {}
  # similar thing can be done for dict1
  if lis1:
      # Do stuff
  else:
      print "List is empty"
  </code></pre>
  
  <p>If I try to do this with my class object, i.e checking if my object attributes are non-empty by typing <code>if my_object:</code> this always evaluate to <code>True</code></p>
  
  <pre><code>&gt;&gt;&gt; class my_class(object):
  ...   def __init__(self):
  ...     self.lis1 = []
  ...     self.dict1 = {}
  ... 
  &gt;&gt;&gt; obj1 = my_class()
  &gt;&gt;&gt; obj1
  &lt;__main__.my_class object at 0x10c793250&gt;
  &gt;&gt;&gt; if obj1:
  ...   print "yes"
  ... 
  yes
  </code></pre>
  
  <p>I can write a function specifically to check if my object attributes are non-empty and then call <code>if obj1.is_attributes_empty():</code>, but I am more interested in knowing how <code>if</code> evaluates the <code>standard data-types</code> like <code>list</code> and <code>dict</code> to <code>True</code> or <code>False</code> depending on the items they contain or are empty. </p>
  
  <p>If I want to achieve this functionality with my class object, what methods do I need to override or make changes to?</p>