url_params = {}
for i in t:
try:
url_params[i] = t.next()
except:
url_params[i] = None
Because this just looks silly to me. I’m converting a list to a dict by pairing up neighboring elements. There are cases, however, where I won’t always have a pair. The tailing element is still important but it’s value isn’t important.
This is more easily done like this:
Example: For
t = range(11), this produces