<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1880" rel="nofollow">http://projects.scipy.org/numpy/ticket/1880</a> on 2011-06-26 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nilswagner01/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nilswagner01">@nilswagner01</a>, assigned to unknown.</em></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="======================================================================
FAIL: test_timedelta_scalar_construction (test_datetime.TestDateTime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File &quot;/home/nwagner/local/lib64/python2.6/site-packages/numpy/core/tests/test_datetime.py&quot;, line 189, in test_timedelta_scalar_construction
    assert_equal(str(np.timedelta64(3, 's')), '3 seconds')
  File &quot;/home/nwagner/local/lib64/python2.6/site-packages/numpy/testing/utils.py&quot;, line 313, in assert_equal
    raise AssertionError(msg)
AssertionError: 
Items are not equal:
 ACTUAL: '%lld seconds'
 DESIRED: '3 seconds'"><pre class="notranslate"><code class="notranslate">======================================================================
FAIL: test_timedelta_scalar_construction (test_datetime.TestDateTime)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/nwagner/local/lib64/python2.6/site-packages/numpy/core/tests/test_datetime.py", line 189, in test_timedelta_scalar_construction
    assert_equal(str(np.timedelta64(3, 's')), '3 seconds')
  File "/home/nwagner/local/lib64/python2.6/site-packages/numpy/testing/utils.py", line 313, in assert_equal
    raise AssertionError(msg)
AssertionError: 
Items are not equal:
 ACTUAL: '%lld seconds'
 DESIRED: '3 seconds'
</code></pre></div>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1887" rel="nofollow">http://projects.scipy.org/numpy/ticket/1887</a> on 2011-06-29 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/dhomeier/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/dhomeier">@dhomeier</a>, assigned to unknown.</em></p>
<p dir="auto">With Python versions 2.4-2.6, the output of np.timedelta only produces the format string since (probably) merging the datetime branch, like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; np.__version__
'2.0.0.dev-f7c16d7'
&gt;&gt;&gt; np.timedelta64(3)
numpy.timedelta64(%lld,'generic')
&gt;&gt;&gt; str(np.timedelta64(3, 's'))
'%lld seconds'"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; np.__version__
'2.0.0.dev-f7c16d7'
&gt;&gt;&gt; np.timedelta64(3)
numpy.timedelta64(%lld,'generic')
&gt;&gt;&gt; str(np.timedelta64(3, 's'))
'%lld seconds'
</code></pre></div>
<p dir="auto">or in the most recent version</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; np.__version__
'2.0.0.dev-192ac74'
&gt;&gt;&gt; np.timedelta64(3)
numpy.timedelta64(%lld)"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; np.__version__
'2.0.0.dev-192ac74'
&gt;&gt;&gt; np.timedelta64(3)
numpy.timedelta64(%lld)
</code></pre></div>
<p dir="auto">making the corresponding tests fail, whereas with 2.7 and 3.2 the intended output is produced:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; np.timedelta64(3)
numpy.timedelta64(3)
&gt;&gt;&gt; str(np.timedelta64(3, 's'))
'3 seconds'"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; np.timedelta64(3)
numpy.timedelta64(3)
&gt;&gt;&gt; str(np.timedelta64(3, 's'))
'3 seconds'
</code></pre></div>
<p dir="auto">(Tested on MacOS X 10.5/ppc and 10.6/x86_64)</p>