''.join(seen.add(c) or c for c in s if c not in seen)

>From what I can understand...

.join will be a String of unique 'c' values.

'seen.add(c) or c' will always point to the second statement 'c'
because seen.add(c) returns None.

'if c not in seen' will ensure 'c' being added to both the .join and
seen is unique.

That is really clever! I like it :) (but does require a bit of
knowledge about .add return None and the affect that has on the ..
or .. statement)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to