[issue40123] append() works not correct

2020-03-31 Thread Steven D'Aprano
Change by Steven D'Aprano : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pytho

[issue40123] append() works not correct

2020-03-31 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi merli, there is no bug here, you always append the same list to Liste so when modifying it you override previous values. You could make a copy of it by using `Liste.append(list(StringL))` instead of `Liste.append(StringL)` and you would get the behaviour you

[issue40123] append() works not correct

2020-03-31 Thread merli
merli added the comment: Output: ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'Bielefeld', 'Paderborn', 'Lemgo'] ['Nr.:', '9', 'B

[issue40123] append() works not correct

2020-03-31 Thread merli
New submission from merli : Please try out and look bug in this example: Liste = [] StringL = ["Nr.:", "NR", "Bielefeld", "Paderborn", "Lemgo"] for i in range (10): StringL[1] = str(i) Liste.append(StringL) print (StringL) #print (Liste) print () print() for i in range (1