A RetroSearch Logo

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

Search Query:

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

[Python-Dev] Re: Decimal data type issues

[Python-Dev] Re: Decimal data type issues [Python-Dev] Re: Decimal data type issuesJewett, Jim J jim.jewett at eds.com
Fri Apr 23 11:50:28 EDT 2004
Batista, Facundo:

> can you trust that the user that uses the
> method from context is aware of binary float traps?

If they are explicitly setting a context, I think
it is reasonable to assume that.  The problem case
is when they just use the default.

	inputcontext.Decimal(1.1)

has made an explicit request for specific handling.

	Decimal(1.1) 

has not indicated any awareness.  

The catch is that we don't want "just make another
context" to become such an idiom for floats that
people do it without knowing why.

Perhaps the Context.Decimal.__init__ could delegate 
to the raise function unless/until the user had set 
an attribute of approximate_float_ok = True.

-jJ

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