Use descriptors.

This commit is contained in:
Guido van Rossum 2005-01-16 00:25:31 +00:00
parent fee7b93c60
commit 5a8a03784e
5 changed files with 9 additions and 11 deletions

View file

@ -446,9 +446,9 @@ def test_bool(self):
def test_subclass_timedelta(self):
class T(timedelta):
@staticmethod
def from_td(td):
return T(td.days, td.seconds, td.microseconds)
from_td = staticmethod(from_td)
def as_hours(self):
sum = (self.days * 24 +