[Python-Dev] os.stat and nanosecond precision

"Martin v. Löwis" martin at v.loewis.de
Fri Jun 3 22:08:47 CEST 2011

> What should the name of the (seconds, nanoseconds) tuple be?

See my comment: -1 on having such a tuple in the first place.
We have the decimal type to represent arbitrary-precision time stamps.

> st_atim, st_ctim and st_mtim has bee suggested and is what the POSIX
> specification uses. This is confusingly similar to the existing
> st_atime, st_ctime and st_mtime.

That the POSIX spec uses it is IMO a strong argument.

> Also, should it be that these attributes are always defined (and just
> have 0 for nanoseconds if the OS doesn't support it)

Definitely. There may be a day when ps, fs, or as resolution comes
along. It would be good if a) the fields are always available, and
b) have "unspecified"/"best-effort" precision, to accomodate future

I wish the decimal type would have been available in 2.3, when
I changed the fields to be doubles instead of longs...


More information about the Python-Dev mailing list