Terry J. Reedy added the comment: I much prefer a new argument, 'strict=False', to a new, near-duplicate function.
locale.atof('2.500,5') should raise. The only question is what should be displayed as the invalid literal: the original or the converted. It seems to me that delocalize should replace the local thousands separator, in this case '.', with ',' as it replaces the local decimal point with '.'. Then the invalid literal would be '1,234.5'. And locale.atof('1.5') would become float('1,5'), which would raise. ---------- nosy: +terry.reedy _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25543> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com