Message83470
Initializing a timedelta object with numpy.int32 arguments give mixed
results; it fails for days keyword, gives bad results for minutes, and
give correct results for seconds/microseconds. Failure confirmed on
Linux i686 (Py 2.5.2; numpy 1.2.1) and OS X 10.5.6 (Py 2.5.1;
1.2.1).Test case below:
from datetime import timedelta
from numpy import int32
from numpy import int32
from datetime import timedelta
assert timedelta(seconds = 36) == timedelta(seconds = int32(36))
print 'pass 36 sec'
assert timedelta(microseconds = 36) == timedelta(microseconds = int32(36))
print 'pass 36 usec'
assert timedelta(minutes = 35) == timedelta(minutes = int32(35))
print 'pass 35 min'
assert timedelta(minutes = 36) == timedelta(minutes = int32(36))
print 'pass 36 min' # returns bad value
assert timedelta(days = 36) == timedelta(days = int32(36))
print 'pass 36 days' # fails SystemError: Objects/longobject.c:223 |
|
Date |
User |
Action |
Args |
2009-03-11 15:50:47 | barronh | set | recipients:
+ barronh |
2009-03-11 15:50:47 | barronh | set | messageid: <1236786647.39.0.745171492116.issue5476@psf.upfronthosting.co.za> |
2009-03-11 15:50:45 | barronh | link | issue5476 messages |
2009-03-11 15:50:45 | barronh | create | |
|