Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python

Name: Anonymous 2009-04-30 16:27

"%d %d %d" % (1,2,3)

vs

"{0} {1} {2}".format(1,2,3)

?

Name: Anonymous 2009-04-30 19:46

>>12
Printf syntax is not the epitome of beauty, but doing what is done to format strings in "py3k" is like replacing regexp syntax with "{1}{3}{2}.".regexp('a'.one_or_more(), re.classes.alpha_num.one_or_more(re.LAZY), re.classes.digit.zero_or_more())
Plus, all those hideous (and compact) %08d don't go anywhere, they are just encased in quotes and put into arguments of string.format().

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List