from copy import deepcopy
class Foo: pass
foo = Foo()
foo.bar = 10
shallow_copies = [foo for _ in range(10)] # todos os foo partilham as mesmas referencias internas
deep_copies = [deepcopy(foo) for _ in range(10)] # copias independentes, referencias diferentes
shallow_copies[0].bar = 100 # mudar valor da propriedade do primeiro foo
deep_copies[0].bar = 100 # mudar valor da propriedade do primeiro foo
print([f.bar for f in shallow_copies]) # [100, 100, 100, 100, 100, 100, 100, 100, 100, 100]
print([f.bar for f in deep_copies]) # [100, 10, 10, 10, 10, 10, 10, 10, 10, 10]
print(all(id(f.bar) ==is id(shallow_copies[0].bar) for f in shallow_copies[1:])) # True , todos os foo tem bar com a mesma ref
print(all(id(f.bar) ==is id(deep_copies[0].bar) for f in deep_copies[1:])) # False