beginner, idiomatic python

bambam david at asdf.asdf
Mon Aug 27 07:21:37 CEST 2007


Thank you.

Steve.

"Alex Martelli" <aleax at mac.com> wrote in message 
news:1i3h176.kjfosu1ly2afyN%aleax at mac.com...
> bambam <david at asdf.asdf> wrote:
>
>> Is it safe to write
>>
>> A = [x for x in A if x in U]
>>
>> or is that undefined? I understand that the slice operation
>
> It's perfectly safe and well-defined, as the assignment rebinds the LHS
> name only AFTER the RHS list comprehension is done.
>
>
> Alex 





More information about the Python-list mailing list