[Python-Dev] *Simpler* string substitutions

Guido van Rossum guido@python.org
Thu, 20 Jun 2002 17:35:41 -0400


> > "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (self.weekdayname[wd],
> >                                          day,
> >                                          self.monthname[month], year,
> >                                          hh, mm, ss)
> 
> This one is part of the small percent that uses formatting codes. It
> wouldn't be rocket science to integrate formatting codes with the "$"
> notation $02d{day} but it would also be fine if this involved a call to
> textutils.printf()

But if you support $02d{day} you should also support $d{day}, but that
already means something different (the variable 'd' followed by '{day}').

--Guido van Rossum (home page: http://www.python.org/~guido/)