python getting instance variables best practice
<p>I was wondering how should one access the instance variables in a python class. Should i make a method for every instance variable or should i access them directly?</p>

<p>Here's an example:</p>

<pre><code>class Example(object):

    def __init__(self):
        self.x = 5

    def getX(self):
        return self.x

    def addYtoX(self, y):
        return self.x + y # OR: return self.getX() + y
</code></pre>

<p>Thank you!</p>
