title: Better to return or update object attributes in Python?
body: <p>I have a class with a function that updates attributes of its objects. I'm trying to figure out which is more pythonic: should I explicitly return the object I'm updating, or simply update the <code>self</code> object?</p>
  
  <p>For example:</p>
  
  <pre><code>class A(object):
  
      def __init__(self):
          self.value = 0
  
      def explicit_value_update(self, other_value):
          # Expect a lot of computation here - not simply a setter
          new_value = other_value * 2
          return new_value
  
      def implicit_value_update(self, other_value):
          # Expect a lot of computation here - not simply a setter
          new_value = other_value * 2
          self.value = new_value
          #  hidden `return None` statement
  
  if __name__ == '__main__':
      a = A()
      a.value = a.explicit_value_update(2)
      a.implicit_value_update(2)
  </code></pre>
  
  <p>I've looked around, but haven't seen any clear answers on this.</p>
  
  <p>EDIT: Specifically, I'm looking for both readability and execution time. Would there be an advantage in either category for either function?</p>