Passing a class's "self" to a function outside it such that the class's variables are accessible and modifiable?
<p>Can I pass the <code>self</code> instance variable of the class from within the class to some helper function outside the class? For example, will the following work when an object of SomeClass is initialized? Isn't there any type casting required? Is this coding style reliable? Is there any possibility of this feature being dropped off in future releases of Python 2.x?</p>

<pre><code>class SomeClass():
    var1 = 7
    def __init__(self):
        some_func(self) # passing self instead of self.var1

def some_func(instance):
    instance.var1 += 1

x = SomeClass()
print x.var1
</code></pre>

<p>I have <code>some_func</code> as a common helper function across many classes that undergo the same transformation, and the <code>var1</code> in my current application is a huge dataFrame which I cannot afford to pass a copy of it to the function due to memory constraints. Do you have any suggestions?  </p>