[Python-Dev] Re: Be Honest about LC_NUMERIC [REPOST]

Martin v. Löwis martin at v.loewis.de
Mon Sep 1 22:36:59 EDT 2003


Guido van Rossum <guido at python.org> writes:

> Here's yet another idea (which probably has flaws as well): instead of
> substituting the locale's decimal separator, rewrite strings like
> "3.14" as "314e-2" and rewrite strings like "3.14e5" as "314e3", then
> pass to strtod(), which assigns the same meaning to such strings in
> all locales.

Unfortunately, that doesn't work for sprintf, for which you still need
to replace the radixchar.

Regards,
Martin



More information about the Python-Dev mailing list