[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-02-26 Thread Larry Hastings
Changes by Larry Hastings : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-02-26 Thread Larry Hastings
Larry Hastings 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, and to accept a "ns=

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread STINNER Victor
STINNER Victor 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) >>> import os >>> s=os.stat("se

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread Martin v . Löwis
Martin v. Löwis 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 _

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread R. David Murray
R. David Murray 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. -- __

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread STINNER Victor
STINNER Victor 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 has a different use case a

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis 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 tracker

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread STINNER Victor
STINNER Victor 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 functions were added to Pyt

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-30 Thread STINNER Victor
STINNER Victor 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 possibility to get decimal.Deci

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-29 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis 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. -- __

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-29 Thread STINNER Victor
STINNER Victor 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 os.stat() would be slower just to

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-26 Thread Larry Hastings
Larry Hastings added the comment: Victor: I *think* Raymond's comments were directed at my patch, not yours. -- ___ Python tracker ___ __

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-26 Thread STINNER Victor
STINNER Victor 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 scan > files for changes

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-25 Thread Raymond Hettinger
Raymond Hettinger 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 scan files for changes and t

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-25 Thread Larry Hastings
Larry Hastings 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, so there might be

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-25 Thread STINNER Victor
STINNER Victor 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 lower bits for big numbers

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-24 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis 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): raise TypeError

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-23 Thread STINNER Victor
STINNER Victor 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 tuple, it's not easy to comp

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2012-01-23 Thread STINNER Victor
STINNER Victor 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 ___ Python tracker

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-15 Thread Eric G. Barron
Changes by Eric G. Barron : -- nosy: +ericography ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-09 Thread Raymond Hettinger
Raymond Hettinger 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 ___

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-09 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-09 Thread Raymond Hettinger
Raymond Hettinger 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 cleanest approach. Ideally,

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-10-09 Thread Larry Hastings
Larry Hastings 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 ___

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-09-29 Thread Stefan Krah
Stefan Krah 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 http://hg.python.org/features/cdecimal#py3k-cdecimal is the same as what wil

[issue11457] os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution

2011-09-29 Thread STINNER Victor
Changes by STINNER Victor : -- title: Expose nanosecond precision from system calls -> os.stat(): add new fields to get timestamps as Decimal objects with nanosecond resolution ___ Python tracker _