Why not FP for Money?

Andrew Dalke adalke at mindspring.com
Sat Sep 25 10:26:35 CEST 2004

Carlos Ribeiro wrote:
> As a compromise, having the 'd' suffix is better than having no option
> to write true decimal point literals.

That's not an effective argument for why a decimal point
should be made a literal.  I use regular expressions much
more often than decimals -- why shouldn't Python, like
Perl, support a regular expression literal?

The tension here is between these ideas:
   Special cases aren't special enough to break the rules.

   Simple is better than complex.

   Although practicality beats purity.

Why is a decimal point literal special enough to break
the rule that nearly all objects (except int, string,
float, complex(!), list, tuple, dict, function, and
class -- that's quite a few) are created using a
call-style syntax?

Is it simpler to limit the number of literals, or
better to simplify making decimal literals?

I'm against adding new literals.  There hasn't been
one added since complex in ... must have been the
mid-1990s.  I'm not the decision maker here but I'll
hazard to guess decimal needs to be used more widely
before making that change.

				dalke at dalkescientific.com

More information about the Python-list mailing list