Mutate Versus Reassign

class Dog:
    tricks = []

    def __init__(self, name):
        self.name = name

d1 = Dog("Rex")
d2 = Dog("Fido")

d1.tricks.append("sit")
d2.tricks = ["roll over"]

Select all statements that are true after these two lines run.

A

d1.tricks and Dog.tricks refer to the exact same list object (d1.tricks is Dog.tricks is True).

B

d1.tricks.append("sit") mutates the same list object that Dog.tricks refers to, so Dog.tricks becomes ['sit'].

C

d2.tricks = ["roll over"] creates a new entry in d2.__dict__, so d2.tricks no longer refers to the shared class-level list at all.

D

Dog.tricks ends up equal to ['sit', 'roll over'], since both instances wrote to tricks.