Christian Reis <kiko@async.com.br> writes: > The underlying truth is that locale-represented values will not be > directly convertible to Python's C-locale values. That is not true. locale.atof should allow you to parse the string. > I'm not sure this is correct. If it isn't I suggest two alternatives: > offer an additional float() that *does* support LC_NUMERIC > (float_localized?), or change float() semantics. I think this is unacceptable. In some languages, "." is used as the thousands-separator. Then, should "1.000" be 1e3, or 1e0? > There may be [broken] code that relies on float raising a TypeError if > something like "50,00" is passed to it, however. Other than that it > seems safe as a special-case. That code is not broken: It is a feature that float() accepts exactly the same syntax that you use in source code; see the documentation for string.atof. Regards, Martin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4