What's the most concise way in Python to group and sum a list of objects by the same property
<p>I have a list of objects of type C, where type C consists of properties X,Y,Z, e.g., c.X, c.Y, c.Z</p>

<p>Now I want to perform the following task:</p>

<ul>
<li>Sum on the property Z of those objects that has the same value for property Y</li>
<li>Output a list of tuples (Y, sum of Zs with this Y)</li>
</ul>

<p>What's the most concise way?</p>
