Question about quoting style.

James Stroud jstroud at mbi.ucla.edu
Tue Oct 2 00:10:11 CEST 2007


Bruno Desthuilliers wrote:
> First point is that Python has no "variable interpolation".

If you squint, it kind of does*:

    >>> print '%(language)s has %(#)03d quote types.' % \
              {'language': "Python", "#": 2}
    Python has 002 quote types.

You might think if the dict as a name space and the formatting operation 
as performing interpolation--but this take on formatting might be a stretch.

James

* http://docs.python.org/lib/typesseq-strings.html



More information about the Python-list mailing list