[Python-Dev] Re: Decimal data type issues (original) (raw)
Jewett, Jim J jim.jewett at eds.com
Fri Apr 23 11:50:28 EDT 2004
- Previous message: [Python-Dev] Re: Decimal data type issues
- Next message: [Python-Dev] PEP 289 - Generator Expressions - Let's Move Forward
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-Dev] Re: Decimal data type issues
- Next message: [Python-Dev] PEP 289 - Generator Expressions - Let's Move Forward
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]