<!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>#- ></FONT>
<BR><FONT SIZE=2>#- > We all must decide which of the following is better:</FONT>
<BR><FONT SIZE=2>#- > </FONT>
<BR><FONT SIZE=2>#- > a) Decimal(number) # no context used</FONT>
<BR><FONT SIZE=2>#- > Decimal(number, context)</FONT>
<BR><FONT SIZE=2>#- > </FONT>
<BR><FONT SIZE=2>#- > b) Decimal(number) # no context used</FONT>
<BR><FONT SIZE=2>#- > 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>#- c) Decimal(number, [context]) # context always used, with </FONT>
<BR><FONT SIZE=2>#- # 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> a) You can specifiy the context as an optional argument.</FONT>
</P>
<P><FONT SIZE=2> Decimal(number, [context])</FONT>
</P>
<P><FONT SIZE=2> You can pass context as an argument, and this context will</FONT>
<BR><FONT SIZE=2> be used at creation time. If you don't pass the context,</FONT>
<BR><FONT SIZE=2> ¿no context is used or is used the "default" one? (with default</FONT>
<BR><FONT SIZE=2> 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> b) You have to specify the context in other method.</FONT>
</P>
<P><FONT SIZE=2> b.1) Decimal(number)</FONT>
</P>
<P><FONT SIZE=2> This way you don't use the context at creation time.</FONT>
</P>
<P><FONT SIZE=2> b.2) Decimal.using_context(number, [context])</FONT>
</P>
<P><FONT SIZE=2> Always a context is used at creation time. If you specify</FONT>
<BR><FONT SIZE=2> the context, that's the one used. If you don't, the</FONT>
<BR><FONT SIZE=2> "default" 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> - Lets you create with no context</FONT>
<BR><FONT SIZE=2> - Lets you create with default context</FONT>
<BR><FONT SIZE=2> - 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>. Facundo</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<P><B><FONT SIZE=2>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</FONT></B></P>
<P><B><U><FONT SIZE=2>ADVERTENCIA </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>