[Python-checkins] peps: PEP 410: os.stat() nanosecond existed since at least Python 2.6
victor.stinner
python-checkins at python.org
Fri Feb 17 02:23:57 CET 2012
http://hg.python.org/peps/rev/0eadd72a908c
changeset: 4060:0eadd72a908c
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Fri Feb 17 02:24:58 2012 +0100
summary:
PEP 410: os.stat() nanosecond existed since at least Python 2.6
files:
pep-0410.txt | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pep-0410.txt b/pep-0410.txt
--- a/pep-0410.txt
+++ b/pep-0410.txt
@@ -25,8 +25,11 @@
os.stat() uses float timestamps by default since Python 2.5. Python 3.3
introduced functions supporting nanosecond resolutions:
- * os module: stat(), utimensat(), futimens()
- * time module: clock_gettime(), clock_getres(), wallclock()
+ * os module: futimens(), utimensat()
+ * time module: clock_gettime(), clock_getres(), monotonic(), wallclock()
+
+os.stat() reads nanoseconds fields of the stat structure, but returns
+timestamps as float.
The Python float type uses binary64 format of the IEEE 754 standard. With a
resolution of 1 nanosecond (10\ :sup:`-9`), float timestamps lose precision for values
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list