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


Groups > comp.lang.python > #41851 > unrolled thread

python3 string format

Started byShiyao Ma <i@introo.me>
First post2013-03-26 12:24 +0800
Last post2013-03-26 12:24 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#41851 — python3 string format

FromShiyao Ma <i@introo.me>
Date2013-03-26 12:24 +0800
Subjectpython3 string format
Message-ID<mailman.3714.1364271854.2939.python-list@python.org>

[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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web