durusmail: qp: QPY support for new string format method?
QPY support for new string format method?
2009-11-02
2009-11-03
2009-11-03
2009-11-04
2009-11-04
QPY support for new string format method?
Michael Watkins
2009-11-02
Is it possible to extend the QPY compiler to recognize:

foo_var = '& quote only these two ampersands &'

    def test:xml():
        '{0}'.format(foo_var)

Currently the entire string object result ends up being quoted, where as
the old string parameter replacement approach quotes only objects not
marked quote-no-more.

    '%s' % foo_var

I haven't started using the new .format() method in earnest but may be
more interested in it if/when the changes to placeholders in 3.1 which
allow implied positional arguements are back ported to > 2.6.

http://docs.python.org/3.1/library/string.html#formatstrings

reply