On Apr 15, 2010, at 3:05 AM, Mladen Milankovic wrote: > q = request.vars.get('q', None) > > You can put anything instead of None. It's like a default value.
Or just q = request.vars.get('q'), since None is the default. This is standard dictionary behavior in Python. It and setdefault are particularly useful dict methods, and worth getting to know.