[Python-Dev] Store timestamps as decimal.Decimal objects

Victor Stinner victor.stinner at haypocalc.com
Tue Jan 31 22:41:39 CET 2012

> (I removed the timespec format, I consider that we don't need it.)
> Rather, I guess you removed it because it didn't fit the "types as flags"
> pattern.

I removed it because I don't like tuple: you cannot do arithmetic on
tuple, like t2-t1. Print a tuple doesn't give you a nice output. It is
used in C because you have no other choice, but in Python, we can do

> As I said in another message, another hint that this is the wrong API design:
> Will the APIs ever support passing in types other than these five?  Probably
> not, so I strongly believe they should not be passed in as types.

I don't know if we should only support 3 types today, or more, but I
suppose that we will add more later (e.g. if datetime is replaced by
another new and better datetime module).

You mean that we should use a string instead of type, so
time.time(format="decimal")? Or do something else?


More information about the Python-Dev mailing list