class....
@property
def degrees(self):
hem, degs, mins, secs = self._correction()
return degs
@property
def minutes(self):
hem, degs, mins, secs = self._correction()
return mins
@property
def seconds(self):
hem, degs, mins, secs = self._correction()
return secs
我在想def可以被截断为:
@property
def hemisphere, degrees, minutes, seconds(self):
hem, degs, mins, secs = self._correction()
return hem, degs, mins, secs
这样当我调用“半球”时,它会返回下摆值等等。
PS。我知道我在后者中的return声明是错误的。我希望你明白我的意思。