STINNER Victor added the comment:
locale.atof() is implemented as float(locale.delocalize(string)).
locale.delocalize() replaces the locale numeric dot with ".":
>>> locale.setlocale(locale.LC_ALL, 'fr_FR.UTF-8')
'fr_FR.UTF-8'
>>> locale.delocalize("1,2")
'1.2'
>>> locale.localeconv()['decimal_point']
','
>>> locale.delocalize("1.2")
'1.2'
I'm not sure that it's very useful to break backward compatibility to be more
strict.
locale.delocalize() and locale.atof() are a few lines of Python, it's probably
worth to copy them and modify them to get the expected behaviour.
----------
nosy: +haypo
versions: +Python 3.6
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25543>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com