Christian Robottom Reis wrote: > The LC_NUMERIC PEP has just been allocated a number, PEP 331. > > http://www.python.org/peps/pep-0331.html > > Though the code has been integrated, comments and corrections to the PEP > would be appreciated -- in particular, Tim might have some comments on > the thread-safety issues, Gustavo, about the implementation or Martin, > about the actual constraints on the change itself. Oh cool. Since we're now setting LC_NUMERIC at the glibc level can we fix up locale.format. It's is very simplistic at the moment as it groups %s items as numbers: locale.format("%s",1234,1) -> '1,234' and treats non numbers as numbers: locale.format("%s\n",1234,1) -> '12,34\n' This could be fixed by only allowing numbers in? Better though would be to pass things down to glibc's snprintf I.E. use the glibc facility of the ' modifier. e.g "%'d" This applies to any decimal conversion (i,d,u,f,F,g,G) You wouldn't have to use it directly, instead in locale.format() you could add in a ' in the appropriate places. Note the ' formating mechanism is SUSV2 not just glibc Pádraig.
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