I was reading about shallow and deep copy in Python where I ran into the following sentence in the documentation:
The difference between shallow and deep copying is only relevant for compound objects (objects that contain other objects, like lists or class instances)
I am confused about what is and isn't a compound object. Based on the above definition (objects that contain other objects) every container is a compound object since every element in a container is an object (because in Python everything is an object even Integer numbers) and the container itself is also an object so every container (with at least one element) is a compound object.
If we agree about what I said, then the first part of the quote about shallow and deep copy "The difference between shallow and deep copying is only relevant for compound objects" would be problematic because then shallow copy for a list of integers should not work while we know that it works:
pp = [1,2,3,4]
qq= copy.copy(pp)
pp[0] = 99
print(pp)
>> [99,2,3,4]
print(qq)
>> [1,2,3,4]
Can someone clarify the meaning of compound object?