title: rename class variables in python without the self
body: <p>Not sure how to quite phrase it, but here's the deal. I have a script where every variable is defined globally, but later I want to convert the script into a class for better encapsulation. </p>
  
  <p>However, all the variables I used in the script needs to be converted into object variables. I would have changed something like</p>
  
  <pre><code>x = 5
  </code></pre>
  
  <p>into</p>
  
  <pre><code>self.x = 5
  </code></pre>
  
  <p>And after doing that all the functions in the script needs to be turned into methods of the class, however, most of the methods are mathematical formulas, and refactoring something as clean as</p>
  
  <pre><code>z = x ** y + x
  </code></pre>
  
  <p>into</p>
  
  <pre><code>z = self.x ** self.y + self.x
  </code></pre>
  
  <p>really hurts readability. </p>
  
  <p>So as a solution to this I've been typing these really awkward re-naming at the beginning of the methods:</p>
  
  <pre><code>def method(self, ...):
    x = self.x
    y = self.y
    ...
  </code></pre>
  
  <p>It makes the formulas readable but typing all that re-naming is really painful, is there a more elegant way of doing this?</p>