title: python's sum() and non-integer values
body: <p>Is there a simple and quick way to use sum() with non-integer values?</p>
  
  <p>So I can use it like this:</p>
  
  <pre><code>class Foo(object):
      def __init__(self,bar)
          self.bar=bar
  
  mylist=[Foo(3),Foo(34),Foo(63),200]
  result=sum(mylist) # result should be 300
  </code></pre>
  
  <p>I tried overriding <code>__add__</code> and <code>__int__</code> etc, but I don't have found a solution yet</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The solution is to implement:</p>
  
  <pre><code> def __radd__(self, other):
      return other + self.bar
  </code></pre>
  
  <p>as Will suggested in his post. But as always, all roads lead to Rome, but I think this is the best solution since I don't need <code>__add__</code> in my class</p>