Larry Hastings la...@hastings.org added the comment:
Given Guido's rejection of PEP 410, this won't happen, so I'm closing this bug.
Our BFDL has specifically rejected any of the complicated representations; he
ruled that all we need are new _ns fields representing the time in nanoseconds,
Changes by Larry Hastings la...@hastings.org:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11457
___
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
I think that one of available types of time values returned by os.stat()
should
allow to directly pass these values to os.futimens() and os.utimensat(), which
expect (time_sec, time_nsec) tuples.
If we choose to give the
STINNER Victor victor.stin...@haypocalc.com added the comment:
I think that one of available types of time values returned by os.stat()
should allow to directly pass these values to os.futimens() and
os.utimensat(), which expect (time_sec, time_nsec) tuples.
Oh, I realized that these two
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:
(secs, nsecs) tuples are more practical in performance-critical applications
(e.g. synchronization of timestamps between 2 trees with large number of files).
--
___
Python
STINNER Victor victor.stin...@haypocalc.com added the comment:
(secs, nsecs) tuples are more practical in performance-critical applications
(e.g. synchronization of timestamps between 2 trees with large number of
files).
This is also why I propose an argument to choose the format: everyone
R. David Murray rdmur...@bitdance.com added the comment:
There is also the fact that we have traditionally exposed thin wrappers around
posix functions (and then were practical provided Windows emulations). We
aren't 100% consistent about this, but we are pretty consistent about it.
Martin v. Löwis mar...@v.loewis.de added the comment:
I know that the underlying C function expects a timespec structure,
but Python can try to use a higher level API, isn't it?
I agree entirely.
--
___
Python tracker rep...@bugs.python.org
STINNER Victor victor.stin...@haypocalc.com added the comment:
I attached a more complete patch to the issue #13882: it adds an optional
timestamp format to os.stat(), os.lstat(), os.fstat(), os.fstatat().
Examples:
$ ./python
Python 3.3.0a0 (default:2914ce82bf89+, Jan 30 2012, 23:07:24)
STINNER Victor victor.stin...@haypocalc.com added the comment:
I don't like the idea of adding new fields to os.stat() *by default* because it
may break backward compatibility. And if the new fields are decimal.Decimal
objects, the module has to be imported and it means that any call to
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:
I think that one of available types of time values returned by os.stat() should
allow to directly pass these values to os.futimens() and os.utimensat(), which
expect (time_sec, time_nsec) tuples.
--
STINNER Victor victor.stin...@haypocalc.com added the comment:
Have you researched how other languages plan to expose sub-millisecond times?
The isn't an API that will get points for originality. Also, it needs to be
an API that is time efficient (many scripts use os.stat() frequently to
Larry Hastings la...@hastings.org added the comment:
Victor: I *think* Raymond's comments were directed at my patch, not yours.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11457
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
Attached patch adds an optional format argument to time.time():
time.time(float) is the same than time.time(), but
time.time(decimal) returns a Decimal object. The Decimal object
stores the resolution of the clock and doesn't loose
Larry Hastings la...@hastings.org added the comment:
Victor: I think your patch merits its own tracker issue; it's only tangentially
related to the proposed changes to os.stat.
That said, please do add me to the nosy list if you create one.
One more thing: I haven't given it a lot of thought,
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
Have you researched how other languages plan to expose sub-millisecond times?
The isn't an API that will get points for originality. Also, it needs to be an
API that is time efficient (many scripts use os.stat() frequently to
Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:
st_atim, st_ctim and st_mtim attributes could be instances of a class
(implemented in posixmodule.c) similar to:
class timespec(tuple):
def __init__(self, arg):
if not isinstance(arg, tuple):
STINNER Victor victor.stin...@haypocalc.com added the comment:
Attached patch prepares time.wallclock() to be able to return the result as an
integer (seconds, nanoseconds).
--
keywords: +patch
Added file: http://bugs.python.org/file24309/time_integer.patch
STINNER Victor victor.stin...@haypocalc.com added the comment:
With the new function time.wallclock() and time.clock_gettime() (issue #10278),
and maybe time.monotonic() will maybe be also added (issue #13846), I now agree
that it is important to support t2-t1 to compute a difference. Using a
Changes by Eric G. Barron e...@ericography.com:
--
nosy: +ericography
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11457
___
___
Python-bugs-list
Larry Hastings la...@hastings.org added the comment:
Can I get some thoughts / votes on whether to
a) check in with the current performance regression, or
b) do the work to make it lazy-created?
--
___
Python tracker rep...@bugs.python.org
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
[Arfrever Frehtes Taifersar Arahesis]
I suggest to have low-level, POSIX-compatible,
(int, int)-based interface in os module and add
high-level, decimal.Decimal-based interface in
shutil module.
I agree that this is the
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11457
___
___
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
One other thought: it would be useful to research how nanosecond-resolution
timestamps are going to be supported in other languages.
--
___
Python tracker rep...@bugs.python.org
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
title: Expose nanosecond precision from system calls - os.stat(): add new
fields to get timestamps as Decimal objects with nanosecond resolution
___
Python tracker rep...@bugs.python.org
Stefan Krah stefan-use...@bytereef.org added the comment:
BTW, what is the status of cdecimal?
I just wrote the same in another issue, but not everyone is subscribed
to that:
I think cdecimal is finished and production ready. The version in
26 matches
Mail list logo