[Python-Dev] Re: Decimal data type issues (original) (raw)
Kevin Jacobs jacobs at theopalgroup.com
Fri Apr 16 10:32:47 EDT 2004
- Previous message: [Python-Dev] Re: Decimal data type issues
- Next message: [Python-Dev] Re: Decimal data type issues
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Batista, Facundo 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.roundedtocontext("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.usingcontext(number, context) "number" can be string, int, etc., but NOT float. The issue with rounding at a defined position has nothing to do with context.
Don't forget that many financial applications use fixed scale and precision as their primary mechanism for specifying Decimal types. As such, it would be very nice to have a constructor that took a literal representation as well as scale and precision. While using context is sufficient, it will be unintuitive and may present an undue burden on many users.
So-many-people-to-make-happy-ly, -Kevin
- Previous message: [Python-Dev] Re: Decimal data type issues
- Next message: [Python-Dev] Re: Decimal data type issues
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]