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/044535.html below:

[Python-Dev] Re: Decimal data type issues

[Python-Dev] Re: Decimal data type issues [Python-Dev] Re: Decimal data type issuesAahz aahz at pythoncraft.com
Thu Apr 22 11:59:09 EDT 2004
On Thu, Apr 22, 2004, Batista, Facundo wrote:
>
> If yes, what about c.create_decimal(number) ?

Sounds good.  If you're going this route, it seems to me that Decimal()
would work better if it ends up being a proxy class for an internal
implementation that's more closely linked to context, and that most of
the Decimal methods simply delegate to the internal implementation
through context.  (If you look at my original implementation, that's
similar to the direction I was going -- haven't actually looked at your
code to see what it's like currently.)  Make sure that Decimal has-a
internal implementation rather than is-a (i.e. use composition instead
of subclassing).

> And with floats? c.create_decimal_from_float(number)? Or the same method
> that before?

``from_float()`` probably is better.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I used to have a .sig but I found it impossible to please everyone..."  --SFJ

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