Python "strange" output
<pre><code>class Foo(object):
    def __init__(self,x):
        self.x = x
        self.is_bar = False
    def __repr__(self): return str(self.x)

class Bar(object):
    def __init__(self,l = []):
        self.l = l
    def add(self,o):
        self.l += [o]
    def __repr__(self): return str(self.l)

def foo_plus_foo(f1,f2):
    t = Bar()
    if not (f1.is_bar and f2.is_bar):
        f1.is_bar = True
        f2.is_bar = True
        t.add(f1)
        t.add(f2)
        print 'HERE'
    return t

if __name__ == '__main__':
    li = [Foo(1), Foo(2)]
    print foo_plus_foo(li[0],li[1])
    print foo_plus_foo(li[0],li[1])
</code></pre>

<p><strong>UNEXPECTED OUTPUT:</strong></p>

<pre><code>HERE
[1, 2]
[1, 2]
</code></pre>

<p><strong>EXPECTED OUTPUT:</strong></p>

<pre><code>HERE
[1, 2]
[]
</code></pre>

<p>What is happening? What did I do wrong? Why is python using old value? What do I do to avoid this?</p>

<p>Thanks! </p>
