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


Groups > comp.lang.python > #45723

Re: PEP 378: Format Specifier for Thousands Separator

Path csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ned@nedbatchelder.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'output': 0.05; 'subject:PEP': 0.07; 'implements': 0.09; 'pep': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '2.7': 0.14; 'language.': 0.14; 'comma': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'specifier': 0.16; 'appropriate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'wed,': 0.18; '>>>': 0.22; 'code,': 0.22; '+0000': 0.22; 'issue.': 0.22; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'features,': 0.24; 'skip:% 10': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'header:In-Reply-To:1': 0.27; 'patch': 0.29; 'code': 0.31; 'getting': 0.31; 'fighting': 0.31; 'running': 0.33; 'call.': 0.33; 'something': 0.35; 'but': 0.35; 'skip:f 40': 0.36; 'email addr:python.org': 0.37; 'fact': 0.38; 'pm,': 0.38; 'little': 0.38; 'how': 0.40; 'even': 0.60; 'above,': 0.60; 'new': 0.61; 'matter': 0.61; 're:': 0.63; 'more': 0.64; 'rendering': 0.68; '2.7.': 0.84; 'all!': 0.84; 'alternative.': 0.84; 'gain,': 0.84; 'carlos': 0.91; 'fight': 0.97; '2013': 0.98
Date Wed, 22 May 2013 07:25:13 -0400
From Ned Batchelder <ned@nedbatchelder.com>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
MIME-Version 1.0
To Carlos Nepomuceno <carlosnepomuceno@outlook.com>
Subject Re: PEP 378: Format Specifier for Thousands Separator
References <knghok$3bd$1@ger.gmane.org> <519c36c6$0$6599$c3e8da3$5496439d@news.astraweb.com> <BLU176-W34B34E0A92C69D61DFCE36D7A90@phx.gbl>
In-Reply-To <BLU176-W34B34E0A92C69D61DFCE36D7A90@phx.gbl>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1959.1369221931.3114.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1369221931 news.xs4all.nl 15897 [2001:888:2000:d::a6]:38965
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:45723

Show key headers only | View raw


On 5/21/2013 11:38 PM, Carlos Nepomuceno wrote:
>> From:steve+comp.lang.python@pearwood.info
>> >Subject: Re: PEP 378: Format Specifier for Thousands Separator
>> >Date: Wed, 22 May 2013 03:08:54 +0000
>> >To:python-list@python.org
> [...]
>>> >>So, the only alternative to have "'%,d' % x" rendering the thousands
>>> >>separator output would a C source code modification?
>> >
>> >That's one alternative. But the language you would be then running will
>> >no longer be Python.
>> >
>> >Another alternative would be to write a pre-processor that parses your
>> >Python source code, extracts any reference to the above, and replaces it
>> >with a call to the appropriate format call. But not only is that a lot of
>> >work for very little gain, but it's also more or less impossible to do in
>> >full generality. And again, what you are running will be something
>> >different than Python, it will be Python plus a pre-processor.
>> >
>> >
>> >Don't fight the language. You will lose.
> Not fighting the language. In fact it's not even a language issue.
> All I need is a standard library[1] improvement: "%,d"! That's all!

You have to keep in mind that 2.7 is not getting any new features, no 
matter how small they seem.  If you create a patch that implements the 
comma flag in %-formatting, it *might* go into 3.x, but it will not go 
into 2.7.

--Ned.

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


Thread

RE: PEP 378: Format Specifier for Thousands Separator Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-21 23:22 +0300
  Re: PEP 378: Format Specifier for Thousands Separator Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-22 02:42 +0000
    RE: PEP 378: Format Specifier for Thousands Separator Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-22 05:56 +0300
      Re: PEP 378: Format Specifier for Thousands Separator Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-22 03:08 +0000
        RE: PEP 378: Format Specifier for Thousands Separator Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-22 06:38 +0300
          Re: PEP 378: Format Specifier for Thousands Separator 88888 Dihedral <dihedral88888@gmail.com> - 2013-05-22 00:14 -0700
        Re: PEP 378: Format Specifier for Thousands Separator Ned Batchelder <ned@nedbatchelder.com> - 2013-05-22 07:25 -0400
        RE: PEP 378: Format Specifier for Thousands Separator Carlos Nepomuceno <carlosnepomuceno@outlook.com> - 2013-05-22 14:52 +0300

csiph-web