Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.06; 'dynamically': 0.07; 'string': 0.09; 'formatting': 0.09; 'git': 0.09; 'lawrence': 0.09; 'pep': 0.09; 'python': 0.11; 'windows': 0.15; 'dictionaries': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'programmer,': 0.16; 'shortcut': 0.16; 'two,': 0.16; "where's": 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'variable': 0.18; 'meant': 0.20; 'thanks.': 0.20; '>>>': 0.22; 'header:User-Agent:1': 0.23; "i've": 0.25; 'compiled': 0.26; 'header:In-Reply-To:1': 0.27; 'michael': 0.29; 'raise': 0.29; 'code': 0.31; 'stuff': 0.32; 'quite': 0.32; 'basic': 0.35; 'but': 0.35; 'idle': 0.36; 'up!': 0.36; 'method': 0.36; "i'll": 0.36; 'being': 0.38; 'sometimes': 0.38; 'message- id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'anything': 0.39; 'ability': 0.39; 'to:addr:python.org': 0.39; 'changed': 0.39; 'enough': 0.39; 'received:org': 0.40; 'most': 0.60; 'new': 0.61; 'kind': 0.63; 'more': 0.64; 'accounts': 0.64; 'acts': 0.74; 'placement': 0.84; 'yours': 0.88; 'wanting': 0.93 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Thu, 31 Oct 2013 22:40:16 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130105 Thunderbird/10.0.12 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Python wart References: <527314E9.2060507@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1383280843 news.xs4all.nl 15922 [2001:888:2000:d::a6]:57836 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:58238 On 10/31/2013 08:56 PM, Mark Lawrence wrote: > On 01/11/2013 02:41, Michael Torrie wrote: >> On 10/31/2013 07:45 PM, Mark Lawrence wrote: >>> Quite often I type this >>> >>> print('Total of accounts %.2f', total) >>> >>> when I meant to type this >>> >>> print('Total of accounts %.2f' % total) >>> >>> Do I have to raise a PEP to get this stupid language changed so that it >>> dynamically recognises what I want it to do and acts accordingly? >>> >>> Yours most frustratedly. >> >> This is one reason I've started using the new string formatting method >> in all my new code. >> > > I'll admit to being a lazy, bone idle git and not wanting to change my > code as a former C programmer, but that strikes me as a cunning plan, > thanks. Now where's my Windows desktop shortcut to the Python compiled > help file? :) I only know enough to do the basic stuff that works for me 3/4 of the time. "{} {} {}".format(one, two, three) Anything more than that I have to look up! Sometimes the ability to use keywords and dictionaries in variable placement is kind of nice.