title: why is this code generating three array values instead of one? python 3.x
body: <p>I have a class, called <code>general</code>, with an array <code>msgs[]</code> as an attribute. There is also an attribute called <code>msg</code>, which is a string. I instantiate three classes, <code>gen0, gen1, gen2</code> and store each object in an array called <code>arr (arr = [gen0, gen1, gen2])</code>. </p>
  
  <p>I have defined a method on class <code>general</code> called <code>snd(self, id, somemsg)</code> which, given the id (to point to the object at the index <code>id</code> in the array <code>arr</code>), appends a string <code>somemsg</code> to the array <code>msgs[]</code>.
  For example, <code>gen0.snd(1,"hello")</code> will perform <code>gen1.msgs.append("hello")</code>.</p>
  
  <pre><code>def snd(self, dst, msg):
      listGens[dst].msgs.append(msg)
  </code></pre>
  
  <p>I have defined the following function, where <code>general</code> is an instantiation of class as defined above.</p>
  
  <pre><code>def playGeneral(general):
      for val in listGens:
          if(val.id is general.id):
              general.snd(general.id, " ")
              continue
          general.snd(val.id, general.oc)
  </code></pre>
  
  <p>When calling<code>playGeneral(gen0)</code>, the <code>somemsg</code> variable has been set to <code>genX.msg = "A"</code>, i.e. the <code>gen0.msg</code>, which happens to be "A"; doing this, we get</p>
  
  <pre><code>playGeneral(listGens[0])
      for val in listGens:
      print(val.msgs)
  
  [' ', 'A', 'A']
  [' ', 'A', 'A']
  [' ', 'A', 'A']
  </code></pre>
  
  <p>I can't understand why this is happening. It should be yielding</p>
  
  <pre><code>[' ']
  ['A']
  ['A']
  </code></pre>