<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [Python-Dev] Re: Decimal data type issues</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>[Aahz]</FONT>
</P>

<P><FONT SIZE=2>#- On Fri, Apr 16, 2004, Batista, Facundo wrote:</FONT>
<BR><FONT SIZE=2>#- &gt;</FONT>
<BR><FONT SIZE=2>#- &gt; We all must decide which of the following is better:</FONT>
<BR><FONT SIZE=2>#- &gt; </FONT>
<BR><FONT SIZE=2>#- &gt;&nbsp;&nbsp; a) Decimal(number)&nbsp;&nbsp;&nbsp;&nbsp; # no context used</FONT>
<BR><FONT SIZE=2>#- &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Decimal(number, context)</FONT>
<BR><FONT SIZE=2>#- &gt; </FONT>
<BR><FONT SIZE=2>#- &gt;&nbsp;&nbsp; b) Decimal(number)&nbsp;&nbsp;&nbsp;&nbsp; # no context used</FONT>
<BR><FONT SIZE=2>#- &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Decimal.using_context(number, context)</FONT>
<BR><FONT SIZE=2>#- </FONT>
<BR><FONT SIZE=2>#- Based on my reading of Tim's posts, there's also</FONT>
<BR><FONT SIZE=2>#- </FONT>
<BR><FONT SIZE=2>#-&nbsp;&nbsp;&nbsp;&nbsp; c) Decimal(number, [context])&nbsp;&nbsp; # context always used, with </FONT>
<BR><FONT SIZE=2>#-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # optional different from default</FONT>
</P>
<BR>

<P><FONT SIZE=2>Got it. But I think there're issues:</FONT>
</P>

<P><FONT SIZE=2>&nbsp; a) You can specifiy the context as an optional argument.</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; Decimal(number, [context])</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; You can pass context as an argument, and this context will</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; be used at creation time. If you don't pass the context,</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; ¿no context is used or is used the &quot;default&quot; one? (with default</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp; I mean the context that it's on the thread at that time).</FONT>
</P>
<BR>

<P><FONT SIZE=2>With another specific method, that's avoided:</FONT>
</P>

<P><FONT SIZE=2>&nbsp; b)&nbsp; You have to specify the context in other method.</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b.1) Decimal(number)</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This way you don't use the context at creation time.</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b.2) Decimal.using_context(number, [context])</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Always a context is used at creation time. If you specify</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the context, that's the one used.&nbsp; If you don't, the</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;default&quot; context is used. </FONT>
</P>
<BR>

<P><FONT SIZE=2>I think the (b) syntax is more clear and less error prone. If you all agree, this can be the way to create from Decimal:</FONT></P>

<P><FONT SIZE=2>&nbsp; - Lets you create with no context</FONT>
<BR><FONT SIZE=2>&nbsp; - Lets you create with default context</FONT>
<BR><FONT SIZE=2>&nbsp; - Lets you create with an specific context</FONT>
</P>

<P><FONT SIZE=2>The issue is how to mix this syntax with the from_float one. What do you propose?</FONT>
</P>

<P><FONT SIZE=2>.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Facundo</FONT>
</P>
<BR>
<BR>
<BR>
<BR>

<P><B><FONT SIZE=2>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</FONT></B></P>

<P><B><U><FONT SIZE=2>ADVERTENCIA&nbsp;</FONT></U> </B>
</P>

<P><B><FONT SIZE=2>La información contenida en este mensaje y cualquier archivo anexo al mismo, son para uso exclusivo del destinatario y pueden contener información confidencial o propietaria, cuya divulgación es sancionada por la ley. </FONT></B></P>

<P><B><FONT SIZE=2>Si Ud. No es uno de los destinatarios consignados o la persona responsable de hacer llegar este mensaje a los destinatarios consignados, no está autorizado a divulgar, copiar, distribuir o retener información (o parte de ella) contenida en este mensaje. Por favor notifíquenos respondiendo al remitente, borre el mensaje original y borre las copias (impresas o grabadas en cualquier medio magnético) que pueda haber realizado del mismo. </FONT></B></P>

<P><B><FONT SIZE=2>Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Telefónica Comunicaciones Personales S.A. o alguna empresa asociada. </FONT></B></P>

<P><B><FONT SIZE=2>Los mensajes electrónicos pueden ser alterados, motivo por el cual Telefónica Comunicaciones Personales S.A. no aceptará ninguna obligación cualquiera sea el resultante de este mensaje. </FONT></B></P>

<P><B><FONT SIZE=2>Muchas Gracias.</FONT></B>
</P>

</BODY>
</HTML>