Path: csiph.com!usenet.pasdenom.info!aioe.org!newsfeed.x-privat.org!news2.euro.net!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.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:string': 0.09; 'width': 0.09; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'bit': 0.19; 'solution.': 0.20; '>>>': 0.22; 'header:User- Agent:1': 0.23; 'instead.': 0.24; 'string,': 0.24; 'subject:/': 0.26; 'header:X-Complaints-To:1': 0.27; 'fixed': 0.29; "skip:' 10": 0.31; 'really,': 0.31; 'but': 0.35; 'there': 0.35; 'work?': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'worth': 0.66; 'frank': 0.68; "'true'": 0.84; 'subject:True': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Frank Millman Subject: True/False formats as 1/0 in a fixed width string Date: Wed, 27 Mar 2013 10:40:19 +0200 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: 197.87.50.233 User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:14.0) Gecko/20120713 Thunderbird/14.0 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1364373633 news.xs4all.nl 6941 [2001:888:2000:d::a6]:50756 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:41988 Hi all This is a bit of trivia, really, as I don't need a solution. But someone might need it one day, so it is worth mentioning. >>> '{}'.format(True) 'True' >>> '{:<10}'.format(True) '1 ' One might want to format True/False in a fixed width string, but it returns 1/0 instead. Is there any way to make this work? Frank Millman