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

Martin v. Löwis martin at v.loewis.de
Tue Sep 2 22:16:50 EDT 2003


"Tim Peters" <tim.one at comcast.net> writes:

> I can't find anything in the std supporting the claim.  For that matter, I
> can't find anything in the std supporting the notion that a locale is
> allowed to insert thousand-separator characters either (can you?).

No: I'm now convinced that sprintf is *forbidden* to insert the
thousands separator. This is why POSIX added the '-flag (%'f); this
will produce the thousands-separator.

That said: Implementations might choose to ignore the standard in that
respect. This issue just supports my thesis that the patch is
complicated: If I have to read the C99 standard to find out whether it
is correct, it must be complicated. I doubt either the submitters or
the original author of the code did that exercise...

> There's lots of stuff allowing a locale to *accept* locale-specific
> spellings (when parsing strings), in addition to the "C" locale spellings;
> the other direction (producing strings) appears much less permissive.

Indeed. I'm not sure whether this is intentional, though.

Regards,
Martin



More information about the Python-Dev mailing list