translating foreign data

Peter J. Holzer hjp-python at hjp.at
Sat Jun 23 08:28:30 EDT 2018


On 2018-06-23 08:12:52 -0400, Richard Damon wrote:
> On 6/23/18 7:46 AM, Steven D'Aprano wrote:
> > On Sat, 23 Jun 2018 06:26:22 -0400, Richard Damon wrote:
> >> If you know the Locale, then you do know what the decimal separator is,
> >> as that is part of what a locale defines.
> > A locale defines a set of common cultural conventions. It doesn't mandate 
> > the actual conventions in use in any specific document.
> >
> > If I'm in Australia, using the en-AU locale, nevertheless I can generate 
> > a file using , as a decimal separator. Try and stop me :-)
> yes, you can MIS-use the en-AU locale and write 1,000 to mean the number
> One, just as you can misuse the language and write cat when you mean a
> member of the Canine group, but then the misinterpretation is on the
> creator of the document, not on the program that was told how the
> document is to be read.

How would he mis-use the en-AU locale to write 1 as "1,000"? I think
to do that he would simply NOT use the locale.

I think there are very good reasons to ignore the locale for specific
purposes. For example, a Python interpreter should not use the locale
when parsing Python, and a program producing Python should also ignore
the locale.

You two also seem to be writing about different things when you write
"THE locale". Steven seems to mean the global settings a user has
chosen, you seem to mean the specidic settings appropriate for parsing a
specific file.

        hp

-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp at hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20180623/0f526623/attachment.sig>


More information about the Python-list mailing list