Interesting (?) problem
Jean-Michel Pichavant
jeanmichel at sequans.com
Mon Jan 11 12:48:35 EST 2010
mk wrote:
>
> Incidentally, it *seems* that list comprehension preserves order:
>
> hostips_limited = [ h for h in hostips if h in thread_results ]
>
> Empirically speaking it seems to work (I tested it on real ips), but
> please correct me if that's wrong.
>
>
>
> Regards,
> mk
>
Sounds good to me.
List are *ordered* items ; it does not suprise me that list
comprehension consistently keep the order.
JM
More information about the Python-list
mailing list