I have created a list of hashes as follows in python:
>>> hash_obj = [{}]*3
However, updating any one of the hashes in this list updates all elements:
>>> hash_obj[0]['a'] = True
>>> print(hash_obj)
[{'a': True}, {'a': True}, {'a': True}
Is there a clean 'pythonic' way to create a list of repeated independent elements? I also think the behaviour here is counterintuitive and should be changed, very interested to know why developers implemented as such.