I want to assign a default value if url parameter is not set. Something like this:
try:
limit = self.request.get('limit')
except NameError:
limit = 10
Of course that didn’t work, that’s why I’m asking. With this code, the default (10) is not being assigned.
dictionary.get method help says:
get(…)
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
Then,
the solution is: