[IronPython] Unpacking

Glauco glauco.uri at prometeia.it
Wed Sep 8 14:29:24 CEST 2010


Il 08/09/2010 13:29, Iivari Mokelainen ha scritto:
> I need to unpack a list of
> [name, x, y, name, x, y]
> to a dictionary
> {name : (x,y), name:(x,y)}
> how would one do that?
>
> Also, is it ok to ask such newbie questions here, or is there a better
> place for that?
>

is better python ML
anyway if you can do first list like this:
my_list = [(name, (x, y)), (name, (x, y))]


a simple
dict( my_list )

do the work


Gla


Il contenuto e gli allegati di questo messaggio sono strettamente confidenziali, e ne sono vietati la diffusione, la riproduzione e l'uso non autorizzato. Il suo contenuto non costituisce impegno da parte della Società salvo accordo scritto tra quest'ultima ed il destinatario. Qualora il presente messaggio Le fosse pervenuto per errore, La preghiamo di comunicare immediatamente al mittente l'errata ricezione e di distruggere quanto ricevuto (compresi i file allegati) senza farne copia.
Qualsivoglia utilizzo non autorizzato del contenuto di questo messaggio costituisce violazione dell'obbligo di non rivelare il contenuto della corrispondenza tra altri soggetti, salvo più grave illecito, ed espone il responsabile alle relative conseguenze.

This e-mail (and any attachment(s)) is strictly confidential and for use only by intended recipient(s). Any use, distribution, reproduction or disclosure by any other person is strictly prohibited. The content of this e-mail does not constitute a commitment by the Company except where provided for in a written agreement between this e-mail addressee and the Company. If you are not an intended recipient(s), please notify the sender promptly and destroy this message and its attachments without reading or saving it in any manner.
Any non authorized use of the content of this message constitutes a violation of the obligation to abstain from learning of the correspondence among other subjects, except for more serious offence, and exposes the person responsible to the relevant consequences.




More information about the Ironpython-users mailing list