Pythonic way of web-programming

Mark E. snowball3 at bigfoot.com
Mon Apr 21 17:48:38 EDT 2003


David Abrahams <dave at boost-consulting.com> wrote:

>    xml.sometag(attr1="value1", attr2="value2", ...)[ "contents" ]

Of course there are always corner cases to deal with. For example, what's a good way
to handle XHTML's 'class' attribute?

xml.sometag(class="css_class_name")["contents"]
won't work.

One could map 'foo_' to 'foo' to handle conflicting names used in xml/html, or allow
a dictionary to serve the same purpose:

xml.sometag({"attr1" : "value1", "class" : "value2"})["contents"]

Mark

-- 
Mark E.: snowball3#&0064;softhome.net




More information about the Python-list mailing list