Returning value to calling class in Python
<p>I’m new to Python and OOP (&amp; StackOverflow), so excuse me if the question is too naïve, but I can’t seem to get it solved on my own. I’ve just written a very simple program to see how OOP works, which I reproduce below:</p>

<pre><code>from System import *

class trial(object):
    def __init__(self, counter):
        self.counter = counter

    def passon(self):
        p = person(self.counter)
        p.increase()

class person(object):
    def __init__(self, counter):
       self.counter = counter


    def increase(self):
       self.counter +=1
       return self.counter
</code></pre>

<p>I call the function like this:</p>

<pre><code>t = trial(2)
t.passon()
</code></pre>

<p>I was expecting the value of counter to updated automatically in class trial, however when I type t.counter, it still returns 2. But if I write:</p>

<pre><code>p = person(t.counter)
p.increase()
</code></pre>

<p>then p.counter becomes 3. How do I increase the value of counter in class trial?
I know I am making some elementary mistake here, but I’d appreciate any help.</p>
