I broke down my problem to the following example program
xy8_block = [
{'pulse': {}},
]
class Dummy:
def __init__(self, block=list(xy8_block)):
self._block = block
dumdum = Dummy()
dumdum._block[0]['pulse']['test'] = 0
print(xy8_block)
If I run the program, the variable xy8_block
is changed, although both variables dumdum._block
and
xy8_block
have both a different memory address.
How can I avoid this problem without directly initialising the class with the value.
Thanks in advance.