[Zope] dtml-in and tuples
Shane Hathaway
shane@digicool.com
Tue, 15 Aug 2000 08:51:23 -0400
Chris Withers wrote:
>
> "R. David Murray" wrote:
> >
> > On Mon, 14 Aug 2000, Jonothan Farr wrote:
> > > Well in Python a list is mutable and a tuple is not.
> >
> > Right, but he's asking why dtml-in treats tuples in a special way,
> > and exactly what that behavior is.
>
> That's right :-)
>
> ..and in particular why it's so weird. It seems to do something like use
> return the last element of the tuple rather than return the tuple
> object...
Looking at the code, it appears that if you pass a list of two-element
tuples, dtml-in will sort by the first element of each pair and render
the second element. If, on the other hand, you pass a list of lists, it
won't try to sort that way.
Shane