I'm trying to figure out how this python properties issue works. But the problem is that in all the net tutorials out there I only find the damn example with only one attribute. I'm looking for an example where you have more to do with day to day. Type with more attributes like name, age, phone, access (boolean), etc. I have doubts like for example, should I create a @property, @setter for each attribute? As would be the example below if we had the data of a person like name, phone, age, email, etc ....
class Person(object):
def __init__(self):
self._name = ''
@property
def name(self):
print "Getting: %s" % self._name
return self._name
@name.setter
def name(self, value):
print "Setting: %s" % value
self._name = value.title()
@name.deleter
def name(self):
print ">Deleting: %s" % self._name
del self._name