class CSStudent:
stream = 'cse'
a = CSStudent()
a.stream = 'ece'
b = CSStudent()
CSStudent.stream = 'mech'
c = CSStudent()
print(a.stream) # ece
print(b.stream) # mech
print(c.stream) # mech
直觉上看的话 a 应该也要被改才对,不知道 py 的机制。 id 看的话 id(a.stream) 的地址确实与 bc 不一样,所以没有受到影响。