It is possible to call reverse with arguments for example:
reverse('page', args=['page1'])
finds the url named page that takes an argument.
My question is how would I do this if I am using Python’s map? I want something of this form:
map(reverse, ITERABLE)
where iterable is a bunch of of named urls with args. Thus far I have been unsuccessful at doing this.
edit based on comments and Adam’s and rulfzid’s answers:
The following iterable is an example that works with both rulfzid’s (editing it as my comment suggests) and Adam’s answer
iterable = [['page', ['about']], ['home', None]]
My only other question is which would be faster?
You could just use a list comprehension:
Assuming, of course, that ITERABLE is something like
[(page, args), (page1, arg1), ...]