Message151912
st_atim, st_ctim and st_mtim attributes could be instances of a class (implemented in posixmodule.c) similar to:
class timespec(tuple):
def __init__(self, arg):
if not isinstance(arg, tuple):
raise TypeError
if len(arg) != 2:
raise TypeError
if not isinstance(arg[0], int):
raise TypeError
if not isinstance(arg[1], int):
raise TypeError
self.sec = arg[0]
self.nsec = arg[1]
tuple.__init__(self)
def __add__(self, other):
if not isinstance(other, timespec):
raise TypeError
ns_sum = (self.sec * 10 ** 9 + self.nsec) + (other.sec * 10 ** 9 + other.nsec)
return timespec(divmod(ns_sum, 10 ** 9))
def __sub__(self, other):
if not isinstance(other, timespec):
raise TypeError
ns_diff = (self.sec * 10 ** 9 + self.nsec) - (other.sec * 10 ** 9 + other.nsec)
return timespec(divmod(ns_diff, 10 ** 9)) |
|
Date |
User |
Action |
Args |
2012-01-24 14:56:26 | Arfrever | set | recipients:
+ Arfrever, loewis, rhettinger, jcea, mark.dickinson, belopolsky, lars.gustaebel, vstinner, larry, nadeem.vawda, r.david.murray, skrah, Alexander.Belopolsky, rosslagerwall, khenriksson, ericography |
2012-01-24 14:56:26 | Arfrever | set | messageid: <1327416986.5.0.999379525719.issue11457@psf.upfronthosting.co.za> |
2012-01-24 14:56:25 | Arfrever | link | issue11457 messages |
2012-01-24 14:56:25 | Arfrever | create | |
|