Can I raise a topic on here about using mutable class variables?
I’ve noticed that in the python documentation that it is frowned upon to use a mutable instance variable such as a list and it’s plainly stated that this is wrong.
For example, for the reasons stated above a list (any mutable type) should not be used as a class variable and instead used as an instance variable.
But, I was thinking, is there not some use cases where using a mutable class variable would be acceptable?
For example, a class variable list to store each object that is created so that each object has access to all other objects that have been created. I.e a Student object that wants to talk to all other Student objects.
Could you help me understand why the documentation is worded like this. I feel I may be missing the point or possibly overthinking it and maybe the documentation is just stating the norm.