Why is this legal?

richard richardjones at optushome.com.au
Wed Sep 8 19:09:08 EDT 2004


Michael George Lerner wrote:
>     cluster = [c for (c.resi,c) in cluster] # undecorate
> 
> That last line actually assigns c.resi for each c in cluster.
> 
> Is there any reason you'd ever want to do this?

Yes, I've done it many times.


    Richard




More information about the Python-list mailing list