Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #41851
| Date | 2013-03-26 12:24 +0800 |
|---|---|
| Subject | python3 string format |
| From | Shiyao Ma <i@introo.me> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3714.1364271854.2939.python-list@python.org> (permalink) |
[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
python3 string format Shiyao Ma <i@introo.me> - 2013-03-26 12:24 +0800
csiph-web