Die Suche ergab 1 Treffer

von hellmerf
Donnerstag 7. Januar 2021, 02:05
Forum: Allgemeine Fragen
Thema: dictionary1 = dictionary0, update dictionary1, dictionary0 == dictionary1 ?
Antworten: 4
Zugriffe: 458

dictionary1 = dictionary0, update dictionary1, dictionary0 == dictionary1 ?

Hallo,
bei der Erstellung einer wx.listCtrl zum update eines dictionaries welches auf Knopfdruck wieder in seinen Initalzustand zurückgesetzt werden soll bin ich auf folgendes (für mich unverständliches) Verhalten gestossen:

dict0 = {'a': 1, 'b': 2}
dict1 = dict0
dict1.update({'b': 3})
print (dict1 ...