Is it possible to extend the QPY compiler to recognize:

foo_var = '& quote only these two ampersands &'

    def test:xml():
        '<span style="font-size:3em;">{0}</span>'.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.

    '<span style="font-size:3em;">%s</span>' % 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

_______________________________________________
QP mailing list
[email protected]
http://mail.mems-exchange.org/mailman/listinfo/qp

Reply via email to