prePEP: Money data type

Alex Martelli aleax at aleax.it
Mon Oct 20 15:29:20 EDT 2003


Batista, Facundo wrote:
   ...
> #- 2. Money objects are presumably immutable, the same
> #- as all other numeric objects. I've edited item 4 to
> #- presume this.
> 
> I added a item #13 that explicitly ask for it to be immutable.

Great -- we all agree on this one.

> There're so many ways, that maybe the best solution is to just let
> everybody to subclass Money and redefine __str__. The problem is that
> decimalSeparator and thousandSeparator are important to parse the string
> in the constructor.

Ah, that's input, not _necessarily_ connected to output; see the
suggestion in my other post about using locale.localeconv().


Alex





More information about the Python-list mailing list