I have many Questions ! look at this code plz:
class Dog(object):
_the_most_oldest = int()
def __init__(self,age):
self.age=age
@staticmethod
@property
def the_most_oldest(age):
if Dog._the_most_oldest < age:
Dog._the_most_oldest=age
return Dog._the_most_oldest
1 :
is it maybe that a property be a static method ??
beacuse I need a really static var that share between instances -> _the_most_oldest dog ! => so I need @property . and because the_most_oldest(age)
method is not for any special instance I need @staticmethod !
2 :
the second thing I need to do is in every instace the_most_oldest shuold be call and calculate and refresh _the_most_oldest var. how do that ? this have Error :
def __init__(self,age):
self.age=age
the_most_oldest(self.age)