<div dir="ltr">On Sat, Jul 19, 2008 at 10:52 PM, Terry Reedy &lt;<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt;&gt;&gt; f.clean(&#39;1&#39;) == Decimal(&#39;1&#39;)<br>
True<br>
</blockquote><div><br>Ah, yes, why didn&#39;t I think of that?<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Since &#39;True&#39; is a keyword, and Guido is *very* reluctant to even add keywords, let alone change their spelling, I think you can depend on that working indefinitely. &nbsp;Similarly, if you now have<br>
<br>
&gt;&gt;&gt; type(a)<br>
&lt;type &#39;int&#39;&gt;<br>
<br>
you test will fail in 3.0 which instead prints &#39;&lt;class &#39;int&#39;&gt;. &nbsp;But<br>
<br>
&gt;&gt;&gt;type(a) is int<br>
True<br>
<br>
will continue working.<br>
<br>
Doctest has two quite different uses. &nbsp;One is to check text with interactive examples to make sure there are no mistakes in the examples. &nbsp;For that, printing representations is usually the natural style. &nbsp;Then one must accept that representations change faster that object behavior.<br>

<br>
The other use is to check code. &nbsp;For that, the more stilted &nbsp;style is more future-proof. &nbsp;For text doing double duty as a formal reference and code test, I would go for cross-version dependability.<br>
<br>
</blockquote><div><br>Thanks, I see your point about the different styles. &nbsp; I think we have a fair number of tests that use the print-style (probably because that&#39;s easiest, and then people see that style everywhere and do the same when adding new tests) when to be future proof they really should be using the alternative.&nbsp; <br>
<br>Karen<br></div></div><br></div>