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/2002-February/020379.html below:

add basic money type to the standard library

[Python-Dev] proposal: add basic money type to the standard library [Python-Dev] proposal: add basic money type to the standard libraryM.-A. Lemburg mal@lemburg.com
Tue, 26 Feb 2002 21:31:52 +0100
Fredrik Lundh wrote:
> 
> and while I'm at it:
> 
> I propose adding an "abstract" money base type to the standard
> library, to be subclassed by real money/decimal implementations.
> 
>     if isinstance(v, basemoney):
>         # yay! it's money
>         print float(money) # let's hope it's not too much
> 
> The goal is not to standardize any behaviour beyond this; anything
> else should be provided by subtypes.
> 
> More details here:
> 
>     http://effbot.org/ideas/money-type.htm
> 
> I can produce PEP and patch if necessary.

Sounds like a plan. 

One thing though: the RE "[+|-]?\d+(.\d+)?" should be extended 
to allow for currency symbols and names in front or after the
monetary value.

Currency for money is a bit like timezones for datetime,
so it's a good idea, not to add it to the base type 
interface. However, the interface should be extendable
to include currency information.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Software:                   http://www.egenix.com/files/python/



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