Message82857
> 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') |
|
Date |
User |
Action |
Args |
2009-02-27 18:25:09 | ezio.melotti | set | recipients:
+ ezio.melotti, LambertDW, Imagist |
2009-02-27 18:25:09 | ezio.melotti | set | messageid: <1235759109.42.0.413847125321.issue5383@psf.upfronthosting.co.za> |
2009-02-27 18:25:07 | ezio.melotti | link | issue5383 messages |
2009-02-27 18:25:07 | ezio.melotti | create | |
|