Re: [Python-Dev] Formatting mini-language suggestion

2009-03-13 Thread Stephen J. Turnbull
Greg Ewing writes: > I don't think you'll want to code the separators into > all your format strings in that case, either. You'll > want some sort of context that you set up for the > page you're about to serve. Sure. But the POSIX locale is not a good solution, nor is it a building block fo

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-13 Thread Greg Ewing
Stephen J. Turnbull wrote: Greg Ewing writes: > If an app is using a particular thousands separator in > one place, it will probably want to use it everywhere. Not if that app is internationalized (eg, a webapp that serves both Americans and Chinese). I don't think you'll want to code the se

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-13 Thread Stephen J. Turnbull
Greg Ewing writes: > Nick Coghlan wrote: > > > [[fill]align][sign][#][0][minimumwidth][,sep][.precision][type] > > > > 'sep' is the new field that defines the thousands separator. > > Wouldn't it be better to use a locale setting for this, > instead of having to specify it in every for

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-12 Thread Greg Ewing
James Y Knight wrote: You might be interested to know that in India, the commas don't come every 3 digits. In india, they come every two digits, after the first three. Thus one billion = 1,00,00,00,000. How are you gonna represent *that* in a formatting mini-language? :) We outsource it.

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-12 Thread Greg Ewing
Nick Coghlan wrote: [[fill]align][sign][#][0][minimumwidth][,sep][.precision][type] 'sep' is the new field that defines the thousands separator. Wouldn't it be better to use a locale setting for this, instead of having to specify it in every format string? If an app is using a particular th

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-12 Thread Jeroen Ruigrok van der Werven
-On [20090312 06:50], Lie Ryan (lie.1...@gmail.com) wrote: >How about having a country code field, e.g. en-us would format according >to US locale, in to India, ch to China, etc... that way the format >string would become very simple (although the lib maintainer would need >to know customs from

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Raymond Hettinger
[Lie Ryan] How about having a country code field, e.g. en-us would format according to US locale, in to India, ch to China, etc... that way the format string would become very simple (although the lib maintainer would need to know customs from all over the world). Then have a special country

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Lie Ryan
James Y Knight wrote: On Mar 11, 2009, at 11:40 PM, Nick Coghlan wrote: Raymond Hettinger wrote: It is not the goal to replace locale or to accomodate every possible convention. The goal is to make a common task easier for many users. The current, default use of the period as a decimal point

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread James Y Knight
On Mar 11, 2009, at 11:40 PM, Nick Coghlan wrote: Raymond Hettinger wrote: It is not the goal to replace locale or to accomodate every possible convention. The goal is to make a common task easier for many users. The current, default use of the period as a decimal point has not proven to be pr

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Guido van Rossum
On Wed, Mar 11, 2009 at 8:34 PM, Raymond Hettinger wrote: >>  I expect that nobody likes that idea, > > Do you mean the idea of a thousands separator > or the idea of also parameterizing the decimal point > or both? Sorry, neither. I meant the idea of having to write a PEP. :-) (Added back pytho

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Raymond Hettinger
[Guido van Rossum] I suggest moving this to python-ideas and writing a proper PEP. Okay, it's moved. Will write up a PEP, do research on what other languages do and collect everyone's ideas on what to put in the shed. (hundreds and ten thousands grouping, various choices of decimal points

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Nick Coghlan
Raymond Hettinger wrote: > > [James Y Knight] >> You might be interested to know that in India, the commas don't come >> every 3 digits. In india, they come every two digits, after the first >> three. Thus one billion = 1,00,00,00,000. How are you gonna represent >> *that* in a formatting mini-

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Guido van Rossum
On Wed, Mar 11, 2009 at 6:01 PM, Antoine Pitrou wrote: > Raymond Hettinger rcn.com> writes: >> >> Financial users in particular find the locale approach to be frustrating and > non-obvious.  Putting in a >> thousands separator is a >> common task for output destined to be read by non-programmers.

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Ben Finney
James Y Knight writes: > You might be interested to know that in India, the commas don't come > every 3 digits. In india, they come every two digits, after the > first three. Thus one billion = 1,00,00,00,000. How are you gonna > represent *that* in a formatting mini-language? :) Likewise, China

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Raymond Hettinger
[James Y Knight] You might be interested to know that in India, the commas don't come every 3 digits. In india, they come every two digits, after the first three. Thus one billion = 1,00,00,00,000. How are you gonna represent *that* in a formatting mini-language? :) It is not the goal to

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread James Y Knight
On Mar 11, 2009, at 9:06 PM, Nick Coghlan wrote: Raymond Hettinger wrote: The current formatting mini-language provisions left/right/center alignment, prefixes for 0b 0x 0o, and rules on when to show the plus-sign. I think it would be far more useful to provision a simple way of specifying a

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Nick Coghlan
Raymond Hettinger wrote: > The current formatting mini-language provisions left/right/center > alignment, prefixes for 0b 0x 0o, and rules on when to show the > plus-sign. I think it would be far more useful to provision a simple > way of specifying a thousands separator. > > Financial users in p

Re: [Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Antoine Pitrou
Raymond Hettinger rcn.com> writes: > > Financial users in particular find the locale approach to be frustrating and non-obvious. Putting in a > thousands separator is a > common task for output destined to be read by non-programmers. Please note that for it to be useful in all parts of the wor

[Python-Dev] Formatting mini-language suggestion

2009-03-11 Thread Raymond Hettinger
The current formatting mini-language provisions left/right/center alignment, prefixes for 0b 0x 0o, and rules on when to show the plus-sign. I think it would be far more useful to provision a simple way of specifying a thousands separator. Financial users in particular find the locale approach