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


Groups > comp.lang.python > #18401

Re: .format vs. %

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!rt.uk.eu.org!news-transit.tcx.org.uk!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.024
X-Spam-Evidence '*H*': 0.95; '*S*': 0.00; 'operator': 0.04; 'python': 0.08; 'php,': 0.09; 'received:209.85.210.174': 0.13; 'received :mail-iy0-f174.google.com': 0.13; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:vs.': 0.16; 'wrote:': 0.18; 'jan': 0.19; 'header:In-Reply-To:1': 0.22; 'string': 0.24; 'stefan': 0.24; 'code': 0.25; 'message-id:@mail.gmail.com': 0.28; 'pm,': 0.29; 'tue,': 0.32; 'people,': 0.32; 'to:addr:python-list': 0.34; 'languages': 0.35; 'similar': 0.36; 'but': 0.37; 'received:google.com': 0.37; "there's": 0.37; 'using': 0.38; 'received:209.85': 0.38; 'else': 0.39; "it's": 0.40; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'huge': 0.61; 'more': 0.61; '2012': 0.67; 'instantly': 0.67; '10:47': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=WMmFuzkRz3swuhXEjnF7n2s6wfsqwM+Nxqwm5S5UE3g=; b=QO2Dw76ZjafHvR/S5OuP46Yf1gIO+nqt2th2lSiSqX1NHHweVBGhr9UHv8vNdgevFi oRHlA7k9gRuv5dN1wJM8ad5eNgw1UmZaSdAivuW4Gf0rnrJ0tQK04tJDoDV/FIzpuRne /3LIxb6oa/UzPHkyvd0ynkSc6BwML147UtTvw=
MIME-Version 1.0
In-Reply-To <20120103114716.GA24859@sleipnir.bytereef.org>
References <5642862.375.1325355574622.JavaMail.geo-discussion-forums@vbbhx10> <4EFF559E.1050408@gmail.com> <mailman.4321.1325544682.27778.python-list@python.org> <fd8933b8-0cca-4127-8f9b-38b056ee075a@h12g2000yqg.googlegroups.com> <4f027b79$0$29880$c3e8da3$5496439d@news.astraweb.com> <CALwzidnvLsamJ=TchqjhZCrXHnP0LyOvg+gSCo+zJ2Edy0W=7w@mail.gmail.com> <4F02DE94.8000506@gmail.com> <20120103114716.GA24859@sleipnir.bytereef.org>
Date Wed, 4 Jan 2012 00:04:31 +1100
Subject Re: .format vs. %
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
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.4349.1325595875.27778.python-list@python.org> (permalink)
Lines 13
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1325595875 news.xs4all.nl 6865 [2001:888:2000:d::a6]:58272
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:18401

Show key headers only | View raw


On Tue, Jan 3, 2012 at 10:47 PM, Stefan Krah <stefan-usenet@bytereef.org> wrote:
> For me the %-style is much more readable.

It's also very similar to C's printf, which means it's similar to
everything else that's similar to printf. That makes it instantly
grokkable to many many people, which is a Good Thing. It's like using
the + operator for string concatenation - there's no requirement to do
so, and not all languages do (REXX, PHP, and SQL come to mind); but
supporting the "obvious thing" gives a huge slab of potential Python
users the chance to understand and write code with one less trip to
the documentation.

ChrisA

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


Thread

.format vs. % davidfx <dgeorge29ca@gmail.com> - 2011-12-31 10:19 -0800
  Re: .format vs. % Andrew Berg <bahamutzero8825@gmail.com> - 2011-12-31 12:34 -0600
  Re: .format vs. % Yaşar Arabacı <yasar11732@gmail.com> - 2011-12-31 20:34 +0200
    Re: .format vs. % davidfx <dgeorge29ca@gmail.com> - 2011-12-31 10:44 -0800
    Re: .format vs. % davidfx <dgeorge29ca@gmail.com> - 2011-12-31 10:44 -0800
      Re: .format vs. % Yaşar Arabacı <yasar11732@gmail.com> - 2011-12-31 20:51 +0200
      Re: .format vs. % Evan Driscoll <edriscoll@wisc.edu> - 2011-12-31 13:47 -0500
        Re: .format vs. % Miki Tebeka <miki.tebeka@gmail.com> - 2012-01-01 13:11 -0800
          Re: .format vs. % Terry Reedy <tjreedy@udel.edu> - 2012-01-02 05:29 -0500
        Re: .format vs. % Miki Tebeka <miki.tebeka@gmail.com> - 2012-01-01 13:11 -0800
      Re: .format vs. % Alexander Kapps <alex.kapps@web.de> - 2011-12-31 19:59 +0100
      Re: .format vs. % Tim Chase <python.list@tim.thechases.com> - 2011-12-31 13:24 -0600
      Re: .format vs. % Lie Ryan <lie.1296@gmail.com> - 2012-01-01 06:34 +1100
      Re: .format vs. % Robert Kern <robert.kern@gmail.com> - 2011-12-31 19:43 +0000
      Re: .format vs. % Terry Reedy <tjreedy@udel.edu> - 2011-12-31 16:09 -0500
  Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-02 14:00 -0800
    Re: .format vs. % Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-02 17:59 -0800
      Re: .format vs. % Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-03 03:52 +0000
        Re: .format vs. % Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-02 22:58 -0700
          Re: .format vs. % Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-03 06:15 +0000
            Re: .format vs. % Ian Kelly <ian.g.kelly@gmail.com> - 2012-01-03 01:16 -0700
            Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-03 05:26 -0800
            Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-03 11:38 -0800
            Re: .format vs. % Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-01-03 15:02 -0500
            Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-03 12:16 -0800
        Re: .format vs. % Andrew Berg <bahamutzero8825@gmail.com> - 2012-01-03 04:55 -0600
        Re: .format vs. % Stefan Krah <stefan-usenet@bytereef.org> - 2012-01-03 12:47 +0100
          Re: .format vs. % Neil Cerutti <neilc@norwich.edu> - 2012-01-03 13:58 +0000
            Re: .format vs. % Stefan Krah <stefan-usenet@bytereef.org> - 2012-01-03 15:17 +0100
              Re: .format vs. % Neil Cerutti <neilc@norwich.edu> - 2012-01-03 15:15 +0000
                Re: .format vs. % Neil Cerutti <neilc@norwich.edu> - 2012-01-03 15:24 +0000
          Re: .format vs. % Neil Cerutti <neilc@norwich.edu> - 2012-01-03 19:46 +0000
            Re: .format vs. % Ethan Furman <ethan@stoneleaf.us> - 2012-01-03 12:00 -0800
            Re: .format vs. % Stefan Krah <stefan-usenet@bytereef.org> - 2012-01-03 21:53 +0100
        Re: .format vs. % Chris Angelico <rosuav@gmail.com> - 2012-01-04 00:04 +1100
  Re: .format vs. % Rick Johnson <rantingrickjohnson@gmail.com> - 2012-01-02 17:51 -0800
    Re: .format vs. % Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-01-03 03:47 +0000
  Re: .format vs. % 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-03 07:47 -0800
    Re: .format vs. % alex23 <wuwei23@gmail.com> - 2012-01-03 18:26 -0800
      Re: .format vs. % 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-04 00:25 -0800
        Re: .format vs. % alex23 <wuwei23@gmail.com> - 2012-01-04 16:23 -0800
          Re: .format vs. % 88888 Dihedral <dihedral88888@googlemail.com> - 2012-01-04 17:41 -0800

csiph-web