title: How to get a list of objects by maximum attribute value from N multi-list of objects?
body: <p>I have a multi-list of objects as follows (simplified version)</p>
  
  <pre><code>listA = [[obj1(val=1),obj2(val=1)],[obj2(val=4),obj3(val=2)]]
  listB = [[obj4(val=1),obj5(val=1)],[obj6(val=5),obj7(val=3)]]
  listC = [[obj8(val=1),obj9(val=1)],[obj10(val=6),obj11(val=4)]]
  </code></pre>
  
  <hr>
  
  <p>I want to get a list of objects from the above multi-list which has the maximum value of a certain attribute by comparing the sub-lists of each multi-list. If the value of the attribute is the same for all the compared objects, it should get any one object.</p>
  
  <p>output:</p>
  
  <pre><code>maxList = [obj1(value=1),obj10(val=6)]
  </code></pre>
  
  <p>There is a similar <a href="https://stackoverflow.com/questions/24209255/get-the-object-with-the-max-attribute-value-in-a-list-of-objects">question</a> to get object with maximum value of attribute from a list, but this case is for multi-list. I know this can be acheived with nested for loops, but there a must be a better way to do this with itertools and getattr ?</p>