Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #41851 > unrolled thread
| Started by | Shiyao Ma <i@introo.me> |
|---|---|
| First post | 2013-03-26 12:24 +0800 |
| Last post | 2013-03-26 12:24 +0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
python3 string format Shiyao Ma <i@introo.me> - 2013-03-26 12:24 +0800
| From | Shiyao Ma <i@introo.me> |
|---|---|
| Date | 2013-03-26 12:24 +0800 |
| Subject | python3 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
Back to top | Article view | comp.lang.python
csiph-web