Francis Girard wrote:
I think your last solution is not good unless your "list" is sorted (in which case the solution is trivial) since you certainly do have to see all the elements in the list before deciding that a given element is not a duplicate. You have to exhaust the iteratable before yielding anything.

I don't follow. The first time I see an element, it is not a duplicate, so I yield it. After that, the element should show up in the 'seen' list, which means I won't yield any of the remaining equivalent elements. Could you explain your logic here?


Steve
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to