Larry Hastings <la...@hastings.org> added the comment: This is probably a terrible idea, but: what about using a subclass of float that internally preserves the original sec / usec values? Call it a utime_float for now. os.stat would produce them, and os.utime would look for them--and if it found one it'd pull out the precise numbers.
Type promotion as a result of binary operators: utime_float OP int = utime_float utime_float OP float = degrades to float I suspect code rarely does math on atime/utime/ctime and then writes out the result. Most of the time they simply propogate the utime values around, comparing them to each other, or setting them unchanged. For those rare occasions when someone wants to change the fractional part of a utime_float, we could provide a function utime_fractional(int) -> utime_float. Advantages: * Nobody has to change any Python code. In almost all circumstances they get complete accuracy for free. Disadvantages: * Complicated. * Is a yucky hack. * Is a terrible idea. (Now I'm sure of it!) ---------- nosy: +larry _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11457> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com