Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45687

Re: PEP 378: Format Specifier for Thousands Separator

Date 2013-05-21 12:41 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: PEP 378: Format Specifier for Thousands Separator
References <BLU176-W10190CB892A0414C988A05D7A80@phx.gbl> <nad-F52CE7.22440720052013@news.gmane.org> <CADUW+M=Y7b=4ZEENVzx4p6YpVD8T0eG=qz7sz8+iEow-5-o+jQ@mail.gmail.com> <BLU176-W9FF52BDCE42DAF40E6AC7D7A80@phx.gbl> <CAMw+j7JdSe2CAs=FF0iYiN-KkmR7uy5g+D3muvFcpvR+HRquOw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1937.1369166505.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 05/21/2013 12:06 PM, Chris “Kwpolska” Warrick wrote:
> On Tue, May 21, 2013 at 8:49 PM, Carlos Nepomuceno wrote:
>>
>> Thank you, but let me rephrase it. I'm already using str.format() but I'd like to use '%' (BINARY_MODULO) operator instead.
>
> There is no real reason to do this.  `str.format()` is the new shiny
> thing you should be using all the time.

.format() is useful, and has it's place, but % formatting is not going away.


>> So, the question is: Where would I change the CPython 2.7.5 source code to enable '%' (BINARY_MODULO) to format using the thousands separator like str.format() does, such as:
>>
>>--> sys.stderr.write('%,d\n' % 1234567)
>> 1,234,567
>
> This will make your code unportable and useless, depending on one
> patch you made.  Please don’t do that.

Agreed.  Unless you're willing to have your programs either run differently, or not at all, on other systems this is the 
wrong way to fix it.


> Where did you learn Python from?  “Python Worst Practice for Dummies”?

Chris Warrick,

Was that necessary? Useful?  Helpful in any way?  If you can't be civil, keep your posts to yourself.

--
~Ethan~

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: PEP 378: Format Specifier for Thousands Separator Ethan Furman <ethan@stoneleaf.us> - 2013-05-21 12:41 -0700

csiph-web