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


Groups > comp.lang.python > #41851

python3 string format

Path csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <i@introo.me>
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; 'python3': 0.07; 'received:209.85.219': 0.09; 'subject:string': 0.09; 'thx': 0.09; 'gpg': 0.16; 'src': 0.16; 'subject:format': 0.16; 'subject:python3': 0.16; 'looked': 0.18; 'mechanism': 0.19; 'pass': 0.26; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'invoke': 0.31; 'class': 0.32; 'received:209.85': 0.35; 'received:google.com': 0.35; 'method': 0.36; 'so,': 0.37; 'received:209': 0.37; 'skip:& 10': 0.38; 'same.': 0.38; 'to:addr :python-list': 0.38; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'url:about': 0.61; 'simply': 0.61; 'more': 0.64; 'url:me': 0.69
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:date:message-id:subject :from:to:content-type:x-gm-message-state; bh=IS/7KQnnKTEk0LeLsJsWrTkrnjMyVQWWh5pdhy2ivro=; b=UKwyZdA+Mdn0qePsWHTDZERY+tUE+LXpfMGtWQyd3H0SvoFcz3M0eMROb87wW3pc9z L01r3+epegx3HG3q8oAmGnDVzKQwMqxP5K8cg7aztdz0ynY79/wPK6XiK8edCau4nBA3 zsUcc8ktdAPfF0TG6TX0+A89sVkcAfsPKGNYiVNF9FBZo8NvwP8Q3fZtMxoOiwnhJ8xf KhxZMNQQyK5TGz/hzcDoZyGtXe66UQnQuXiV5dBLAkFmV+Qe4Q1Izo7eur2YxvYthFYC NfPJd2/6e2knbOV98rHbh6D62Xq1O10HldrtaywC+GUZ25ZK3tmmiUkrXVVvfj8quSQ8 QAug==
MIME-Version 1.0
X-Received by 10.60.31.79 with SMTP id y15mr13086014oeh.123.1364271851855; Mon, 25 Mar 2013 21:24:11 -0700 (PDT)
X-Originating-IP [202.112.3.7]
Date Tue, 26 Mar 2013 12:24:11 +0800
Subject python3 string format
From Shiyao Ma <i@introo.me>
To python-list@python.org
Content-Type multipart/alternative; boundary=e89a8fb1f1641b725f04d8cc4b37
X-Gm-Message-State ALoCoQmPRhisvITbnsuH2iSMpXX3mhA704i/vgNu2D5uspjA6lwpIAmpw5DfVxpRtVh/ybGwDtRT
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.3714.1364271854.2939.python-list@python.org> (permalink)
Lines 38
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1364271854 news.xs4all.nl 6855 [2001:888:2000:d::a6]:39490
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:41851

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

HI.
one thing confuses me.
It is said in the pep3101 that "{}".format (x) will invoke the method
x.__format__
However, I looked at the src of python3 and found:
in class str(object), the format simply contains a pass statement
in class int(object), things is the same.

So, what's the mechanism that "{}" works?
Thx

-- 
My gpg pubring is available via: gpg --keyserver
subkeys.pgp.net--recv-keys 307CF736

More on: http://about.me/introom

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


Thread

python3 string format Shiyao Ma <i@introo.me> - 2013-03-26 12:24 +0800

csiph-web