newb question about @property
On Sun, 1 Oct 2017 08:47 am, Bill wrote:
> I spent a few hours experimenting with @property. To my mind it seems
> like it would be preferable to just define (override) instance methods
> __get__(), __set__(), and possibly __del__(), as desired, as I could
> easily provide them with "ideal" customization. Am I overlooking something?
This is a particularly simple example, with only getters. How would you write it
by overriding __get__?
def __init__(self, centre, radius):
self.centre = centre
self.radius = radius
?Cheer up,? they said, ?things could be worse.? So I cheered up, and sure
enough, things got worse.