Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-18 Thread Greg Ewing
Guido van Rossum wrote: if there is an *actual* causal link between file A and B, the difference in timestamps should always be much larger than 100 ns. And if there isn't a causal link, simultaneity is relative anyway. To Fred sitting at his computer, file A might have been created before

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-18 Thread Ben Finney
Greg Ewing greg.ew...@canterbury.ac.nz writes: Guido van Rossum wrote: if there is an *actual* causal link between file A and B, the difference in timestamps should always be much larger than 100 ns. And if there isn't a causal link, simultaneity is relative anyway. To Fred sitting at

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-17 Thread Steven D'Aprano
Georg Brandl wrote: Am 16.02.2012 11:14, schrieb Martin v. Löwis: Am 16.02.2012 10:51, schrieb Victor Stinner: 2012/2/16 Martin v. Löwis mar...@v.loewis.de: Maybe an alternative PEP could be written that supports the filesystem copying use case only, using some specialized ns APIs? I really

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-17 Thread Victor Stinner
Maybe it's okay to wait a few years on this, until either 128-bit floats are more common or cDecimal becomes the default floating point type? In the mean time for clock freaks we can have a few specialized APIs that return times in nanoseconds as a (long) integer. I don't think that the

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-17 Thread Nick Coghlan
On Fri, Feb 17, 2012 at 9:33 PM, Victor Stinner victor.stin...@gmail.com wrote: Maybe it's okay to wait a few years on this, until either 128-bit floats are more common or cDecimal becomes the default floating point type? In the mean time for clock freaks we can have a few specialized APIs

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-17 Thread Stefan Krah
Victor Stinner victor.stin...@gmail.com wrote: Can't we improve the compatibility between Decimal and float, e.g. by allowing Decimal+float? Decimal (base 10) + float (base 2) may loss precision and this issue matters in some use cases. So we still need a way to warn the user on loss of

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-17 Thread Larry Hastings
On 02/16/2012 02:14 AM, Martin v. Löwis wrote: Am 16.02.2012 10:51, schrieb Victor Stinner: 2012/2/16 Martin v. Löwismar...@v.loewis.de: Maybe an alternative PEP could be written that supports the filesystem copying use case only, using some specialized ns APIs? I really think that all you

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-17 Thread Georg Brandl
Am 17.02.2012 10:28, schrieb Steven D'Aprano: Georg Brandl wrote: Am 16.02.2012 11:14, schrieb Martin v. Löwis: Am 16.02.2012 10:51, schrieb Victor Stinner: 2012/2/16 Martin v. Löwis mar...@v.loewis.de: Maybe an alternative PEP could be written that supports the filesystem copying use case

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Martin v. Löwis
Am 15.02.2012 21:06, schrieb Antoine Pitrou: On Wed, 15 Feb 2012 20:56:26 +0100 Martin v. Löwis mar...@v.loewis.de wrote: With the quartz in Victor's machine, a single clock takes 0.3ns, so three of them make a nanosecond. As the quartz may not be entirely accurate (and also as the CPU

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Martin v. Löwis
Maybe an alternative PEP could be written that supports the filesystem copying use case only, using some specialized ns APIs? I really think that all you need is st_{a,c,m}time_ns fields and os.utime_ns(). I'm -1 on that, because it will make people write complicated code. Regards, Martin

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
2012/2/16 Martin v. Löwis mar...@v.loewis.de: Maybe an alternative PEP could be written that supports the filesystem copying use case only, using some specialized ns APIs? I really think that all you need is st_{a,c,m}time_ns fields and os.utime_ns(). I'm -1 on that, because it will make

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Martin v. Löwis
Am 16.02.2012 10:51, schrieb Victor Stinner: 2012/2/16 Martin v. Löwis mar...@v.loewis.de: Maybe an alternative PEP could be written that supports the filesystem copying use case only, using some specialized ns APIs? I really think that all you need is st_{a,c,m}time_ns fields and

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
2012/2/15 Guido van Rossum gu...@python.org: So using floats we can match 100ns precision, right? Nope, not to store an Epoch timestamp newer than january 1987: x=2**29; (x+1e-7) != x # no loss of precision True x=2**30; (x+1e-7) != x # lose precision False

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
A data point on this specific use case.  The following code throws its assert ~90% of the time in Python 3.2.2 on a modern Linux machine (assuming foo exists and bar does not):   import shutil   import os   shutil.copy2(foo, bar)   assert os.stat(foo).st_mtime == os.stat(bar).st_mtime It

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
PEP author Victor asked (in http://mail.python.org/pipermail/python-dev/2012-February/116499.html): Maybe I missed the answer, but how do you handle timestamp with an unspecified starting point like os.times() or time.clock()? Should we leave these function unchanged? If *all* you know is

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Antoine Pitrou
On Thu, 16 Feb 2012 13:46:18 +0100 Victor Stinner victor.stin...@gmail.com wrote: Let's try in a ext4 filesystem: $ ~/prog/python/timestamp/python Python 3.3.0a0 (default:35d6cc531800+, Feb 16 2012, 13:32:56) import decimal, os, shutil, time open(test, x).close() shutil.copy2(test,

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
The way Linux does that is to use the time-stamping counter of the processor (the rdtsc instructions), which (originally) counts one unit per CPU clock. I believe current processors use slightly different countings (e.g. through the APIC), but still: you get a resolution within the clock

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
If I run your snippet and inspect modification times using `stat`, the difference is much smaller (around 10 ns, not 1 ms): $ stat test | \grep Modify Modify: 2012-02-16 13:51:25.643597139 +0100 $ stat test2 | \grep Modify Modify: 2012-02-16 13:51:25.643597126 +0100 The loss of precision

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Antoine Pitrou
Le jeudi 16 février 2012 à 14:20 +0100, Victor Stinner a écrit : If I run your snippet and inspect modification times using `stat`, the difference is much smaller (around 10 ns, not 1 ms): $ stat test | \grep Modify Modify: 2012-02-16 13:51:25.643597139 +0100 $ stat test2 | \grep

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Larry Hastings
On 02/15/2012 08:12 PM, Guido van Rossum wrote: On Wed, Feb 15, 2012 at 7:28 PM, Larry Hastingsla...@hastings.org wrote: I fixed this in trunk last September (issue 12904); os.utime now preserves all the precision that Python currently conveys. So, essentially you fixed this particular issue

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
$ stat test | \grep Modify Modify: 2012-02-16 13:51:25.643597139 +0100 $ stat test2 | \grep Modify Modify: 2012-02-16 13:51:25.643597126 +0100 The loss of precision is not constant: it depends on the timestamp value. Well, I've tried several times and I can't reproduce a 1 ms

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Guido van Rossum
On Thu, Feb 16, 2012 at 2:04 PM, Victor Stinner victor.stin...@gmail.com wrote: It doesn't change anything to the Makefile issue, if timestamps are different in a single nanosecond, they are seen as different by make (by another program comparing the timestamp of two files using nanosecond

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
2012/2/16 Guido van Rossum gu...@python.org: On Thu, Feb 16, 2012 at 2:04 PM, Victor Stinner victor.stin...@gmail.com wrote: It doesn't change anything to the Makefile issue, if timestamps are different in a single nanosecond, they are seen as different by make (by another program comparing

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Guido van Rossum
On Thu, Feb 16, 2012 at 2:48 PM, Victor Stinner victor.stin...@gmail.com wrote: 2012/2/16 Guido van Rossum gu...@python.org: On Thu, Feb 16, 2012 at 2:04 PM, Victor Stinner victor.stin...@gmail.com wrote: It doesn't change anything to the Makefile issue, if timestamps are different in a

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Victor Stinner
The problem is that shutil.copy2() produces sometimes *older* timestamp :-/ (...) Have you been able to reproduce this with an actual Makefile? What's the scenario? Hum. I asked the Internet who use shutil.copy2() and I found an old issue (Decimal('43462967.173053') seconds ago): Python

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Guido van Rossum
So, make is unaffected. In my first post on this subject I already noted that the only real use case is making a directory or filesystem copy and then verifying that the copy is identical using native tools that compare times with nsec precision. At least one of the bugs you quote is about the

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Alexander Belopolsky
On Wed, Feb 15, 2012 at 11:39 AM, Guido van Rossum gu...@python.org wrote: Maybe it's okay to wait a few years on this, until either 128-bit floats are more common or cDecimal becomes the default floating point type? +1 ___ Python-Dev mailing list

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-16 Thread Georg Brandl
Am 16.02.2012 11:14, schrieb Martin v. Löwis: Am 16.02.2012 10:51, schrieb Victor Stinner: 2012/2/16 Martin v. Löwis mar...@v.loewis.de: Maybe an alternative PEP could be written that supports the filesystem copying use case only, using some specialized ns APIs? I really think that all you

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Martin v. Löwis
Am 14.02.2012 23:29, schrieb Barry Warsaw: I think I will just state my reasoning one last time and then leave it to the BDFL or BDFOP to make the final decision. I'd like to remind people what the original point of the PEP process was: to avoid going in cycles in discussions. To achieve this,

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Dirkjan Ochtman
On Wed, Feb 15, 2012 at 10:11, Martin v. Löwis mar...@v.loewis.de wrote: My primary concern with the PEP is adding to users confusion when they have to handle (at least) 5 different types[*] that represent time in Python. I agree with Barry here (despite having voiced support for using

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Nick Coghlan
On Wed, Feb 15, 2012 at 7:11 PM, Martin v. Löwis mar...@v.loewis.de wrote: I agree with Barry here (despite having voiced support for using Decimal before): datetime.datetime *is* the right data type to represent time stamps. If it means that it needs to be improved before it can be used in

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Victor Stinner
I agree with Barry here (despite having voiced support for using Decimal before): datetime.datetime *is* the right data type to represent time stamps. If it means that it needs to be improved before it can be used in practice, then so be it - improve it. Maybe I missed the answer, but how do

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Victor Stinner
2012/2/15 Martin v. Löwis mar...@v.loewis.de: I agree with Barry here (despite having voiced support for using Decimal before): datetime.datetime *is* the right data type to represent time stamps. If it means that it needs to be improved before it can be used in practice, then so be it -

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Victor Stinner
I'd like to remind people what the original point of the PEP process was: to avoid going in cycles in discussions. To achieve this, the PEP author is supposed to record all objections in the PEP, even if he disagrees (and may state rebuttals for each objection that people brought up). So,

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Barry Warsaw
On Feb 15, 2012, at 10:23 AM, Nick Coghlan wrote: What should timedelta.total_seconds() return to avoid losing nanosecond precision? How should this be requested when calling the API? See, I have no problem having this method return a Decimal for high precision values. This preserves the

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Barry Warsaw
On Feb 15, 2012, at 10:11 AM, Martin v. Löwis wrote: I think improving datetime needs to go in two directions: a) arbitrary-precision second fractions. My motivation for proposing/supporting Decimal was that it can support arbitrary precision, unlike any of the alternatives (except for

[Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Jim J. Jewett
PEP author Victor asked (in http://mail.python.org/pipermail/python-dev/2012-February/116499.html): Maybe I missed the answer, but how do you handle timestamp with an unspecified starting point like os.times() or time.clock()? Should we leave these function unchanged? If *all* you know is

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Guido van Rossum
I just came to this thread. Having read the good arguments on both sides, I keep wondering why anybody would care about nanosecond precision in timestamps. Unless you're in charge of managing one of the few atomic reference clocks in the world, your clock is not going to tell time that accurate.

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Antoine Pitrou
On Wed, 15 Feb 2012 08:39:45 -0800 Guido van Rossum gu...@python.org wrote: What purpose is there to recording timestamps in nanoseconds? For clocks that start when the process starts running, float *is* (basically) good enough. For measuring e.g. file access times, there is no way that the

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Guido van Rossum
On Wed, Feb 15, 2012 at 8:47 AM, Antoine Pitrou solip...@pitrou.net wrote: On Wed, 15 Feb 2012 08:39:45 -0800 Guido van Rossum gu...@python.org wrote: What purpose is there to recording timestamps in nanoseconds? For clocks that start when the process starts running, float *is* (basically)

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Victor Stinner
2012/2/15 Guido van Rossum gu...@python.org: I just came to this thread. Having read the good arguments on both sides, I keep wondering why anybody would care about nanosecond precision in timestamps. Python 3.3 exposes C functions that return timespec structure. This structure contains a

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Antoine Pitrou
On Wed, 15 Feb 2012 18:23:55 +0100 Victor Stinner victor.stin...@gmail.com wrote: Linux supports nanosecond timestamps since Linux 2.6, Windows supports 100 ns resolution since Windows 2000 or maybe before. It doesn't mean that Windows system clock is accurate: in practical, it's hard to get

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Guido van Rossum
On Wed, Feb 15, 2012 at 9:23 AM, Victor Stinner victor.stin...@gmail.com wrote: 2012/2/15 Guido van Rossum gu...@python.org: I just came to this thread. Having read the good arguments on both sides, I keep wondering why anybody would care about nanosecond precision in timestamps. Python 3.3

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Victor Stinner
Linux supports nanosecond timestamps since Linux 2.6, Windows supports 100 ns resolution since Windows 2000 or maybe before. It doesn't mean that Windows system clock is accurate: in practical, it's hard to get something better than 1 ms :-) Well, do you think the Linux system clock is

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Guido van Rossum
So using floats we can match 100ns precision, right? On Wed, Feb 15, 2012 at 9:58 AM, Victor Stinner victor.stin...@gmail.com wrote: Linux supports nanosecond timestamps since Linux 2.6, Windows supports 100 ns resolution since Windows 2000 or maybe before. It doesn't mean that Windows system

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Antoine Pitrou
Le mercredi 15 février 2012 à 18:58 +0100, Victor Stinner a écrit : It gives me differences smaller than 1000 ns on Ubuntu 11.10 and a Intel Core i5 @ 3.33GHz: $ ./a.out 0 s, 781 ns $ ./a.out 0 s, 785 ns $ ./a.out 0 s, 798 ns $ ./a.out 0 s, 818 ns $ ./a.out 0 s, 270 ns What is it

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Martin v. Löwis
*Apart* from the specific use case of making an exact copy of a directory tree that can be verified by other tools that simply compare the nanosecond times for equality, I don't see any reason for complicating so many APIs to preserve the fake precision. As far as simply comparing whether one

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Martin v. Löwis
Am 15.02.2012 19:10, schrieb Antoine Pitrou: Le mercredi 15 février 2012 à 18:58 +0100, Victor Stinner a écrit : It gives me differences smaller than 1000 ns on Ubuntu 11.10 and a Intel Core i5 @ 3.33GHz: $ ./a.out 0 s, 781 ns $ ./a.out 0 s, 785 ns $ ./a.out 0 s, 798 ns $ ./a.out 0

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Antoine Pitrou
On Wed, 15 Feb 2012 20:56:26 +0100 Martin v. Löwis mar...@v.loewis.de wrote: With the quartz in Victor's machine, a single clock takes 0.3ns, so three of them make a nanosecond. As the quartz may not be entirely accurate (and also as the CPU frequency may change) you have to measure the

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Mark Shannon
Antoine Pitrou wrote: On Wed, 15 Feb 2012 20:56:26 +0100 Martin v. Löwis mar...@v.loewis.de wrote: With the quartz in Victor's machine, a single clock takes 0.3ns, so three of them make a nanosecond. As the quartz may not be entirely accurate (and also as the CPU frequency may change) you have

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Benjamin Peterson
2012/2/15 Mark Shannon m...@hotpy.org: I reckon PyPy might be able to call clock_gettime() in a tight loop almost as frequently as the C program (although not with the overhead of converting to a decimal). The nanosecond resolution is just as meaningless in C. -- Regards, Benjamin

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Guido van Rossum
On Wed, Feb 15, 2012 at 11:38 AM, Martin v. Löwis mar...@v.loewis.de wrote: *Apart* from the specific use case of making an exact copy of a directory tree that can be verified by other tools that simply compare the nanosecond times for equality, I don't see any reason for complicating so many

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Greg Ewing
On 16/02/12 06:43, Guido van Rossum wrote: This does not explain why microseconds aren't good enough. It seems none of the clocks involved can actually measure even relative time intervals more accurate than 100ns, and I expect that kernels don't actually keep their clock more accurate than

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Guido van Rossum
On Wed, Feb 15, 2012 at 6:06 PM, Greg Ewing greg.ew...@canterbury.ac.nz wrote: On 16/02/12 06:43, Guido van Rossum wrote: This does not explain why microseconds aren't good enough. It seems none of the clocks involved can actually measure even relative time intervals more accurate than 100ns,

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Ben Finney
Guido van Rossum gu...@python.org writes: On Wed, Feb 15, 2012 at 6:06 PM, Greg Ewing greg.ew...@canterbury.ac.nz wrote: It probably isn't worth the bother for things like file timestamps, where the time taken to execute the system call that modifies the file is likely to be several

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Larry Hastings
On 02/15/2012 09:43 AM, Guido van Rossum wrote: *Apart* from the specific use case of making an exact copy of a directory tree that can be verified by other tools that simply compare the nanosecond times for equality, A data point on this specific use case. The following code throws its

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-15 Thread Guido van Rossum
On Wed, Feb 15, 2012 at 7:28 PM, Larry Hastings la...@hastings.org wrote: On 02/15/2012 09:43 AM, Guido van Rossum wrote: *Apart* from the specific use case of making an exact copy of a directory tree that can be verified by other tools that simply compare the nanosecond times for equality,

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Victor Stinner
A datetime module based approach would need to either use a mix of datetime.datetime() (when returning an absolute time) and datetime.timedelta() (when returning a time relative to an unknown starting point), Returning a different type depending on the function would be surprising and

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Dirkjan Ochtman
FWIW, I'm with Barry on this; doing more with the datetime types seems preferable to introducing yet more different stuff to date/time handling. On Mon, Feb 13, 2012 at 19:33, Victor Stinner victor.stin...@gmail.com wrote: Oh, I forgot to mention my main concern about datetime: many functions

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Victor Stinner
IMO supporting nanosecond in datetime and timedelta is an orthogonal issue. Not if you use it to cast them aside for this issue. ;) Hum yes, I wanted to say that even if we don't keep datetime as a supported type for time.time(), we can still patch the type to make it support nanosecond

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Barry Warsaw
On Feb 13, 2012, at 07:33 PM, Victor Stinner wrote: Oh, I forgot to mention my main concern about datetime: many functions returning timestamp have an undefined starting point (an no timezone information ), and so cannot be converted to datetime: - time.clock(), time.wallclock(),

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Victor Stinner
2012/2/14 Barry Warsaw ba...@python.org: On Feb 13, 2012, at 07:33 PM, Victor Stinner wrote: Oh, I forgot to mention my main concern about datetime: many functions returning timestamp have an undefined starting point (an no timezone information ), and so cannot be converted to datetime: -

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Victor Stinner
(Oops, I sent my email by mistake, here is the end of my email) (...) Ah, timedelta case is different. But I already replied to Nick in this thread about timedelta. You can also see arguments against timedelta in the PEP 410. Victor ___ Python-Dev

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Barry Warsaw
I think I will just state my reasoning one last time and then leave it to the BDFL or BDFOP to make the final decision. Victor on IRC says that there is not much difference between Decimal and timedelta, and this may be true from an implementation point of view. From a cognitive point of view, I

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Nick Coghlan
On Wed, Feb 15, 2012 at 8:29 AM, Barry Warsaw ba...@python.org wrote: My primary concern with the PEP is adding to users confusion when they have to handle (at least) 5 different types[*] that represent time in Python. My key question to those advocating the use of timedelta instead of Decimal:

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Gregory P. Smith
On Tue, Feb 14, 2012 at 2:29 PM, Barry Warsaw ba...@python.org wrote: I think I will just state my reasoning one last time and then leave it to the BDFL or BDFOP to make the final decision. Victor on IRC says that there is not much difference between Decimal and timedelta, and this may be

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Gregory P. Smith
On Tue, Feb 14, 2012 at 4:23 PM, Nick Coghlan ncogh...@gmail.com wrote: On Wed, Feb 15, 2012 at 8:29 AM, Barry Warsaw ba...@python.org wrote: My primary concern with the PEP is adding to users confusion when they have to handle (at least) 5 different types[*] that represent time in Python.

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-14 Thread Gregory P. Smith
On Tue, Feb 14, 2012 at 5:13 PM, Gregory P. Smith g...@krypto.org wrote: On Tue, Feb 14, 2012 at 4:23 PM, Nick Coghlan ncogh...@gmail.com wrote: On Wed, Feb 15, 2012 at 8:29 AM, Barry Warsaw ba...@python.org wrote: My primary concern with the PEP is adding to users confusion when they have to

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-13 Thread Barry Warsaw
On Feb 13, 2012, at 01:28 AM, Victor Stinner wrote: I'm still waiting for Nick Coghlan and Guido van Rossum for their decision on the PEP. Thanks for continuing to work on this Victor. I agree with the general motivation behind the PEP, and appreciate your enthusiasm for improving Python here.

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-13 Thread Victor Stinner
However, I am still -1 on the solution proposed by the PEP. I still think that migrating to datetime use is a better way to go, rather than a proliferation of the data types used to represent timestamps, along with an API to specify the type of data returned. Let's look at each item in the

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-13 Thread Victor Stinner
Antoine Pitrou conviced me to drop simply the int type: float and Decimal are just enough. Use an explicit cast using int() to get int. os.stat_float_times() is still deprecated by the PEP. Victor ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-13 Thread Nick Coghlan
On Tue, Feb 14, 2012 at 4:33 AM, Victor Stinner victor.stin...@gmail.com wrote: However, I am still -1 on the solution proposed by the PEP.  I still think that migrating to datetime use is a better way to go, rather than a proliferation of the data types used to represent timestamps, along with

[Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-12 Thread Victor Stinner
Hi, I finished the implementation of the PEP 410 (Use decimal.Decimal type for timestamps). The PEP: http://www.python.org/dev/peps/pep-0410/ The implementation: http://bugs.python.org/issue13882 Rietveld code review tool for this issue: http://bugs.python.org/review/13882/show The patch is

Re: [Python-Dev] PEP 410 (Decimal timestamp): the implementation is ready for a review

2012-02-12 Thread Nick Coghlan
On Mon, Feb 13, 2012 at 10:28 AM, Victor Stinner victor.stin...@gmail.com wrote: Hi, I finished the implementation of the PEP 410 (Use decimal.Decimal type for timestamps). The PEP: http://www.python.org/dev/peps/pep-0410/ The implementation: http://bugs.python.org/issue13882 Rietveld