May-13-2017, 03:14 AM
To add, even properties should only really be used when the getter/setter needs to do actual work. You don't need to (and shouldn't) use them just because you think you need getters/setters.
For example if you have a rect class and want to be able to set/get a "center" property. The set/get functions would alter the actual object attributes appropriately.
This tut I did goes into that a bit (and descriptors):
https://python-forum.io/Thread-Classes-a...escriptors
For example if you have a rect class and want to be able to set/get a "center" property. The set/get functions would alter the actual object attributes appropriately.
This tut I did goes into that a bit (and descriptors):
https://python-forum.io/Thread-Classes-a...escriptors