<br><br><div class="gmail_quote">On Sun, Mar 6, 2011 at 11:24 PM, Raymond Hettinger <span dir="ltr"><<a href="mailto:raymond.hettinger@gmail.com">raymond.hettinger@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div style="word-wrap:break-word"><div class="im"><br><div><div>On Mar 6, 2011, at 10:06 PM, Bruce Leban wrote:</div><br><blockquote type="cite"><div class="gmail_quote">. Personally, the xml writer seems like a reasonable use to me.</div>

</blockquote><br></div></div><div>I'm surprised that you like the XML writer.  To me it seems much more awkward to type the python code than the XML it generates:</div><div><br></div><div><font class="Apple-style-span" face="monospace"><span class="Apple-style-span" style="font-size: 11px; white-space: pre-wrap;"><snip></span></font></div>

</div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><font face="monospace" size="3"><span style="font-size:11px;white-space:pre-wrap">At least in this example, it seems to me that the XML writer created more work and more complexity than it saved.</span></font></div>

</div></blockquote><div><br></div><div>I agree for this example. In real code, it wouldn't all be static. It would be like:</div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">with x.element('foo'):</font></div></div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">  for a in stuff:</font></div>

</div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">    with x.element('bar'):</font></div></div><div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">      a.render(x)</font></div>

</div></blockquote><div class="gmail_quote"><div><br></div><div>I like that better than something like this:</div><div><br></div></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;">

<div class="gmail_quote"><div><font class="Apple-style-span" face="'courier new', monospace">x.write(x.element('foo', </font><span class="Apple-style-span" style="font-family: 'courier new', monospace; ">[x.element('bar', a.render()) for a in stuff]))</span></div>

</div></blockquote><div class="gmail_quote"><div><br></div><div>--- Bruce</div></div>