[Zope] first-variables in a simple loop on a list

Dieter Maurer dieter at handshake.de
Wed Sep 24 21:06:53 EDT 2003


Smith, Neil (Worcester) wrote at 2003-9-24 16:42 +0100:
 > ...
 > Now I really only want the unique values from the list.  I figured the best
 > way would be to sort the list then use the first- grouping variables.

I think, the "reorder" function (available in "DTML" as "_.reorder")
is a better choice.

You use it this way:	"[x[0] for x in _.reorder(l)]"
where "l" is your list.


Dieter



More information about the Zope mailing list