On Jan 27, 9:14 pm, Malcolm Tredinnick <malc...@pointy-stick.com> wrote: > This isn't anything to do with reverse(). It's a Python thing. The > "args" argument has to be a sequence. A list or a tuple, for example.
Ah, I hadn't thought of that. Somewhere deep within the Django source, something probably says "for arg in args". The REASON I didn't think of that is because of what it says when it displays the exception: "with arguments '('1', '2')' ". In order to print that, I thought Django ran the function tuple() on args, and I couldn't figure out why. I tried putting in args=['1', '2'], and the exception said "with arguments '('1', '2')' " again. Why did it turn the square brackets into parens? I took this as further evidence that Django ran the function tuple() on args, turning any list into a tuple. I couldn't figure out why they would do that. Now I see that the parens in the exception are probably meaningless - it doesn't matter what kind of sequence it is, and it's not actually being converted into a tuple, it is just being written between parens for the purpose of the exception. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---