21 May
2005
21 May
'05
6:03 a.m.
On May 21, 2005, at 2:45 PM, Fred Drake wrote:
On 5/21/05, Paul Everitt <paul@zope-europe.org> wrote:
if viewarg: result = style.apply(doc, viewarg=viewarg) else: result = style.apply(doc)
...it would be nice to say:
viewarg = None result = style.apply(doc, viewarg=viewarg)
No; you expecting lxml to assign semantics to missing values from your application, which is wrong. Try this instead:
kw = {} if viewarg: kw["viewarg"] = viewarg result = style.apply(doc, **kw)
This keeps understanding of parameter values where it belongs: in the application that provides them.
Yep, just what I needed. Thanks Fred! --Paul