title: Setting attributes python
body: <p>This is a follow up from my last question as to why the setattr within a class for a method did not work and I found an answer on it but now I have a small problem with it</p>
  
  <pre><code>class Test:
      def myString(self, var):
          Test.myString.string = var
          return self.myString
  </code></pre>
  
  <p>I then do this</p>
  
  <pre><code>x = Test()
  x.myString("test").string
  </code></pre>
  
  <p>It returns test but then I try this</p>
  
  <pre><code>y = list()
  [y.append(x.myString(str(i))) for i in range(10)]
  </code></pre>
  
  <p>then try to get the list by doing this, <code>[j.string for j in y]</code> and it returns 9 total digits of nine. Is their a way to fix this so it appends the number it's currently on? </p>