"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:

> [EMAIL PROTECTED] wrote:
>
>> John Salerno:
>>> What does everyone think about this?
>> 
>> The Example 2 builds a list, that is then thrown away. It's just a
>> waste of memory (and time).
>
> No, it doesn't.

This line:

    [new.append(c) for c in s if c not in new]

...throws away the list built by the comprehension itself, composed of
None values (returned by append).

> It uses append because it refers to itself in the if-expression. So
> the append(c) is needed

The append is not in question here.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to