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


Groups > comp.lang.python > #8045

Re: new string-formatting preferred? (was "What is this syntax ?")

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python.list@tim.thechases.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '2.x': 0.05; 'formatting': 0.07; 'python': 0.08; '3.0,': 0.09; 'subject:string': 0.09; 'pm,': 0.10; 'described': 0.14; 'wrote:': 0.14; '-tkc': 0.16; 'finney': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'message-id:@tim.thechases.com': 0.16; 'new-style': 0.16; 'received:70.251': 0.16; 'received:dsl.rcsntx.swbell.net': 0.16; 'received:rcsntx.swbell.net': 0.16; 'received:swbell.net': 0.16; 'subject:formatting': 0.16; 'subject:syntax': 0.16; 'url:format': 0.16; 'wins': 0.16; 'subject:was': 0.16; 'cc:addr:python-list': 0.17; 'header:In-Reply-To:1': 0.21; "haven't": 0.22; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'preferred': 0.26; 'missed': 0.26; 'string': 0.26; 'cc:addr:python.org': 0.30; 'style.': 0.30; 'url:library': 0.31; 'operations': 0.33; 'lines': 0.33; "i've": 0.33; 'there': 0.35; 'header:User-Agent:1': 0.35; 'subject:What': 0.35; 'skip:. 10': 0.36; 'subject:new': 0.37; 'url:docs': 0.37; 'url:python': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'should': 0.39; 'feature': 0.40; 'link': 0.64; 'became': 0.67; 'subject:this': 0.76; '\xe2\x80\x9cthis': 0.84
Date Mon, 20 Jun 2011 19:46:13 -0500
From Tim Chase <python.list@tim.thechases.com>
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
MIME-Version 1.0
To Ben Finney <ben+python@benfinney.id.au>
Subject Re: new string-formatting preferred? (was "What is this syntax ?")
References <mailman.178.1308554725.1164.python-list@python.org> <87pqm8qh7m.fsf@benfinney.id.au>
In-Reply-To <87pqm8qh7m.fsf@benfinney.id.au>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - boston.accountservergroup.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - tim.thechases.com
X-Source
X-Source-Args
X-Source-Dir
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
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.204.1308617185.1164.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 82.94.164.166
X-Trace 1308617185 news.xs4all.nl 49178 [::ffff:82.94.164.166]:38409
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8045

Show key headers only | View raw


On 06/20/2011 05:19 PM, Ben Finney wrote:
> “This method of string formatting is the new standard in
> Python 3.0, and should be preferred to the % formatting
> described in String Formatting Operations in new code.”
>
> <URL:http://docs.python.org/library/stdtypes.html#str.format>

Is there a good link to a thread-archive on when/why/how 
.format(...) became "preferred to the % formatting"?  I haven't 
seen any great wins of the new formatting over the classic style. 
  Is there some great feature of new-style formatting that I've 
missed out on that obviates bajillions of lines of 2.x code?

-tkc

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


Thread

Re: What is this syntax ? Claudiu Popa <cpopa@bitdefender.com> - 2011-06-20 10:18 +0300
  Re: What is this syntax ? Ben Finney <ben+python@benfinney.id.au> - 2011-06-21 08:19 +1000
    Re: new string-formatting preferred? (was "What is this syntax ?") Tim Chase <python.list@tim.thechases.com> - 2011-06-20 19:46 -0500
    Re: new string-formatting preferred? (was "What is this syntax ?") Terry Reedy <tjreedy@udel.edu> - 2011-06-20 22:17 -0400
    Re: new string-formatting preferred? (was "What is this syntax ?") Tim Chase <python.list@tim.thechases.com> - 2011-06-21 06:33 -0500
    Re: new string-formatting preferred? (was "What is this syntax ?") Terry Reedy <tjreedy@udel.edu> - 2011-06-21 18:19 -0400
    Re: new string-formatting preferred? (was "What is this syntax ?") Tim Chase <python.list@tim.thechases.com> - 2011-06-21 18:02 -0500

csiph-web