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

Smith, Neil (Worcester) Neil.Smith at npower.com
Thu Sep 25 05:44:30 EDT 2003


On Thu, 25 Sep 2003, Dieter Maurer wrote
> Smith, Neil (Worcester) wrote at 2003-9-24 16:42 +0100:
> > Now I really only want the unique values from the list.
>
> 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

Excellent, just what I wanted.  I'd looked at reorder but hadn't been able
to figure out from the documentation exactly what it did.  I'm still not
sure about the with and without, but I'll check the source now I know it's
useful.

Thanks Dieter

-- 
Neil



**********************************************************************
 
The information contained in this e-mail is confidential and intended only for the use of the addressee. If the reader of this message is not the addressee, you are hereby notified that you have received this e-mail in error and you must not copy, disseminate, distribute, use or take any action as a result of the information contained in it.
    
If you have received this e-mail in error, please notify postmaster at npower.com (UK 01384 275454) and delete it immediately from your system.
    
Neither Npower nor any of the other companies in the Innogy group from whom this e-mail originates accept any responsibility for losses or damage as a result of any viruses and it is your responsibility to check attachments (if any) for viruses.  Npower Limited Registered office: Windmill Hill Business Park, Whitehill Way, Swindon SN5 6PB. Registered in England and Wales: number 3653277. This e-mail may be sent on behalf of a member of the Innogy group of companies.

**********************************************************************




More information about the Zope mailing list