A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-April/044332.html below:

[Python-Dev] Re: Decimal data type issues

[Python-Dev] Re: Decimal data type issues [Python-Dev] Re: Decimal data type issuesCasey Duncan casey at zope.com
Fri Apr 16 10:32:14 EDT 2004
On Fri, 16 Apr 2004 10:53:35 -0300
"Batista, Facundo" <FBatista at uniFON.com.ar> wrote:

> [Casey Duncan]
> 
> #- I find boolean arguments a general anti-pattern, especially given
> #we- have class methods. Why not use an alternate constructor like::
> #- 
> #-   pi = 
> #- Decimal.rounded_to_context("3.1415926535897932384626433832795")
> 
> This is a good idea to me.
> 
> We all must decide which of the following is better:
> 
>   a) Decimal(number)     # no context used
>      Decimal(number, context)
> 
>   b) Decimal(number)     # no context used
>      Decimal.using_context(number, context)

If the context must be explicitly provided as an argument (rather than
just a flag) I think a) is better. It depends also on what other
arguments the constructor has, and thus what other contracts it
fulfills. Are there other optional arguments?

-Casey


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4