how to conditionally add a dict in-line

Wes James comptekki at
Mon Feb 23 23:35:38 EST 2009

I have this line:

navs.append(A(' '+str(i+1)+'
or ''})))

How do I do something like this:

vars={'_page':i, if request.vars._query not None then insert this
key/value pair ('_query':request.vars._query) else insert nothing }



More information about the Python-list mailing list