21 May
2005
21 May
'05
7:45 a.m.
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. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> Zope Corporation