[issue39315] Lists of objects containing lists

2020-01-12 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: No problem, you're welcome :) -- ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue39315] Lists of objects containing lists

2020-01-12 Thread hmathers
hmathers added the comment: I should have known I was just doing something wrong. Thank you for your help! -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker _

[issue39315] Lists of objects containing lists

2020-01-12 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: You are appending to the class attribute where both shelf[0] and shelf[1] refers to the same list as seen by output of id. You might want to create an instance variable and use it for mutating across different instances. This could help : https://

[issue39315] Lists of objects containing lists

2020-01-12 Thread hmathers
New submission from hmathers : class Folder(): papers = [] shelf = [] shelf.append(Folder) shelf.append(Folder) shelf[0].papers.append("one") shelf[1].papers.append("two") print(shelf[0].papers) #should just print "one" right? -- messages: 359858 nosy: hmathers priority: normal se