<span class="Apple-style-span" style="border-collapse: collapse; "><div class="Ih2E3d" style="color: rgb(80, 0, 80); ">On Tue, Mar 25, 2008 at 9:46 AM, Oleg Broytmann &lt;<a href="mailto:phd@phd.pp.ru" style="color: rgb(0, 0, 204); ">phd@phd.pp.ru</a>&gt; wrote:<br>
&gt; &nbsp; &nbsp;In 2.5.2 it prints<br>&gt;<br>&gt; &nbsp;&lt;type &#39;str&#39;&gt;<br>&gt; &nbsp;&lt;type &#39;unicode&#39;&gt;<br>&gt;<br>&gt; &nbsp; &nbsp;Why the change? Is it a bug or a feature? Shouldn&#39;t .to_eng_string()<br>&gt; &nbsp;always return a str?<br>
<br></div>I&#39;d call this a bug. &nbsp;The change is an accident, a side-effect of the fact<br>that in 2.5.1 the coefficient (mantissa) of a Decimal was stored as a<br>tuple, and in 2.5.2 it&#39;s stored as a string (which greatly improves efficiency).<br>
Clearly in 2.5.2 the mantissa is being stored as a unicode instance in the<br>second case; &nbsp;it should be explicitly coerced to str in Decimal.__new__.<br><br>If others agree that it&#39;s a bug, I&#39;ll fix it.<br><font color="#888888"><br>
Mark</font></span><br>