title: Python class methods
body: <p>I have a class as follows:</p>
  
  <pre><code>class X:
      def __init__(self):
            self.sum_x =0.0
            self.sum_x_squared=0.0
            self.var_x =0.0
            self.sum_y =0.0
            self.sum_y_squared=0.0
            self.var_y =0.0
  
      def update(self,data):
           [x,y,vx,vy]=data
           self.update_sums(self.sum_x,self.sum_x_squared,x)
           self.update_sums(self.sum_y,self.sum_y_squared,y)
           .
  
  
      def update_sums(self,sums,squares,val):
            sums += val
            squares += val*val
            .
  </code></pre>
  
  <p>I would like to pass the member variables <code>sum_x</code>, <code>sum_x_squared</code> etc to the <code>update_sums</code> function for update how do I do this, I am confused.</p>
  
  <p>Thanks</p>