[issue5620] The attribute's action of an object is not correct.

2009-04-01 Thread edmundy
edmundy yong.su...@163.com added the comment: Thanks a lot! Kozyarchuk. I have thought the self.myurl should be the object variable, not class variable. The class variable really is confusing. Why do they like that? -- status: open - closed ___

[issue5620] The attribute's action of an object is not correct.

2009-03-31 Thread edmundy
New submission from edmundy yong.su...@163.com: The following is the test code. class C1: myurl = [] def test(self): url = [5,6,7] self.myurl.extend(url) def testv(): c = C1() c.test() print(c.myurl)

[issue5620] The attribute's action of an object is not correct.

2009-03-31 Thread Maksim Kozyarchuk
Maksim Kozyarchuk maksim_kozyarc...@yahoo.com added the comment: AFAIK, This is expected behavior. myurl is a class attribute if you want it to be different per instance you should re-initialize it in the __init__ method. See below. class C1(object): ... def __init__(self): ...