Hello again all :) I had a free afternoon, so I implemented this :)
Fyi, this is my first branch with Hg, so I can't guarantee that I did
it correctly. I still need to add support for:
.float()
.mktime()
.timetuple()
.gmtime()
.localtime()
We should also add support for doing:
process.start_time == (123, 567)
In order to make it more tuple-like.
Thanks!
> Fyi, this is my first branch with Hg, so I can't guarantee that I did
> it correctly. I still need to add support for:
I added tests for those.
> We should also add support for doing:
>
> process.start_time == (123, 567)
>
> In order to make it more tuple-like.
That's a good idea. But what about addition, subtraction with tuples?
Should that work too?
Another point that I'm as yet undecided is if you should be able to
compare (and add/subtract) with integers/floats where the number would
be treated as a timestamp.
Related to this, should 'int(timespec_obj)' and 'float(timespec_obj)'
work too?
I'm tempted to say yes to most of these things, but it makes things
more implicit and maybe explicit is better as it's clear what's
happening.
Anyway, none of these questions are a blocker for starting to use the
TimeSpec class.
Regards
Floris
--
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org