Re: [Python-ideas] Support WHATWG versions of legacy encodings

2018-01-28 Thread Stephen J. Turnbull
Sorry for the long delay. I had a lot on my plate at work, and was spending 14 hours a day sleeping because of the flu. "It got better." Rob Speer writes: > I don't really understand what you're doing when you take a > fragment of my sentence where I explain a wrong understanding of >

Re: [Python-ideas] Format mini-language for lakh and crore

2018-01-28 Thread Nathaniel Smith
On Sun, Jan 28, 2018 at 5:31 PM, David Mertz wrote: > I actually didn't know about `locale.format("%d", 10e9, grouping=True)`. > But it's still much less general than having the option in the > f-string/.format() mini-language. This is really about the formatted > string, not

Re: [Python-ideas] Format mini-language for lakh and crore

2018-01-28 Thread David Mertz
I actually didn't know about `locale.format("%d", 10e9, grouping=True)`. But it's still much less general than having the option in the f-string/.format() mini-language. This is really about the formatted string, not necessarily about the locale. So, e.g. I'd like to be able to write: >>>

Re: [Python-ideas] Logging: a more perseverent version of the StreamHandler?

2018-01-28 Thread Steven D'Aprano
On Fri, Jan 26, 2018 at 09:46:51PM +0100, liam marsh wrote: > Hello, > Some time ago, I set up some logging using stdout in a program with the > `stdout_redirected()` context manager, which had to close and reopen > stdout to work. > Unsurprisingly, the StreamHandler didn't take it well. > > So

Re: [Python-ideas] Format mini-language for lakh and crore

2018-01-28 Thread Nathaniel Smith
On Sun, Jan 28, 2018 at 5:46 AM, Eric V. Smith wrote: > If I recall correctly, we discussed this at the time, and the problem with > locale is that it's not thread safe. I agree that if it were, it would be > nice to be able to use it, either with 'n', or in some other mode

Re: [Python-ideas] Why CPython is still behind in performance for some widely used patterns ?

2018-01-28 Thread Antoine Pitrou
On Sat, 27 Jan 2018 22:18:08 +0100 Pau Freixes wrote: > > Correct me if I'm wrong, but most of you argue that the proper Zen of > Python - can we say it mutability [1]? as Victor pointed out - that > allow the user have the freedom to mutate objects in runtime goes in > the

Re: [Python-ideas] Format mini-language for lakh and crore

2018-01-28 Thread Eric V. Smith
On 1/28/2018 6:51 AM, Nick Coghlan wrote: On 28 January 2018 at 19:30, Stephan Houben wrote: Hi David, Perhaps the "n" locale-dependent number formatting specifier should accept a , to have locale-appropriate formatting of thousand separators? f"{x:,n}" would Do The

Re: [Python-ideas] Format mini-language for lakh and crore

2018-01-28 Thread Nick Coghlan
On 28 January 2018 at 19:30, Stephan Houben wrote: > Hi David, > > Perhaps the "n" locale-dependent number formatting specifier > should accept a , to have locale-appropriate formatting of thousand > separators? > > f"{x:,n}" > > would Do The Right Thing(TM) depending on the

Re: [Python-ideas] Format mini-language for lakh and crore

2018-01-28 Thread Alex Walters
It’s my opinion that instead of adding syntax, we should instead encourage using number formatting library functions. * You can replace the function or have the function dispatch differently depending on locale * It means that syntax doesn’t need to be extended for every use case – its

Re: [Python-ideas] Format mini-language for lakh and crore

2018-01-28 Thread Stephan Houben
Hi David, Perhaps the "n" locale-dependent number formatting specifier should accept a , to have locale-appropriate formatting of thousand separators? f"{x:,n}" would Do The Right Thing(TM) depending on the locale. Today it is an error. Stephan 2018-01-28 7:25 GMT+01:00 David Mertz