mirror of
https://github.com/python/cpython.git
synced 2025-11-03 15:11:34 +00:00
Use descriptors.
This commit is contained in:
parent
fee7b93c60
commit
5a8a03784e
5 changed files with 9 additions and 11 deletions
|
|
@ -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 +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue