Ezio Melotti <ezio.melo...@gmail.com> added the comment: > xhtmlNode('div','Hello, world',id='sidebar')
> ... but this would not have symmetry with the generated xhtml and > therefore complicates the code. The solution, in my opinion, is to > allow varargs to be intermixed with keyword args. The above real-world > example shows a use-case for this more flexible functionality. IMHO your API is confusing in the first place, if xhtmlNode is supposed to create an XHTML element (possibly with attributes), why would you want to pass also the content as a positional argument? I would probably keep the element and its content separate and do something like: div = xhtmlNode('div', **attributes) div.add(TextNode('Hello World')) or, if you want a shortcut: xhtmlNode('div', id='sidebar', content='Hello world') or xhtmlNode('div', id='sidebar', text='Hello world') ---------- nosy: +ezio.melotti _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5383> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com