[Python-3000] format() method and % operator

Victor Stinner victor.stinner at haypocalc.com
Fri Aug 17 11:23:00 CEST 2007


Hi,
I read many people saying that
 "{0} {1}".format('Hello', 'World')
is easiert to read than
 "%s %s" % ('Hello', 'World')
But for me it looks to be more complex: we have to maintain indexes (0, 1, 
2, ...), marker is different ({0} != {1}), etc.
I didn't read the PEP nor all email discussions. So can you tell me if it 
would be possible to write simply:
 "{} {}".format('Hello', 'World')
Victor Stinner aka haypo
http://hachoir.org/


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /