Feb-23-2019, 02:57 AM
__del__ is triggered when an instance is garbage collected, not the class. So I can't imagine calling it to shut down class attributes. Then those attributes would not be available for later instances.
I used class variables for two things: constants specific to the class and used across instances, and data about the instances (like a counter for how many have been created, to make unique IDs for the instances). I can't say that's all I would use them for, but that is all I've ever felt the need to use them for.
I used class variables for two things: constants specific to the class and used across instances, and data about the instances (like a counter for how many have been created, to make unique IDs for the instances). I can't say that's all I would use them for, but that is all I've ever felt the need to use them for.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures