Paul McGuire <[EMAIL PROTECTED]> writes: > I'm still getting used to 'any' and 'all' as new Python built-ins - > but they'll do the short-circuiting as well as a for-loop-with-break. > But I think a set- or dict-based solution will still surpass a list- > based one for the OP.
I guess I don't understand sufficiently well what the OP is trying to do. If it's just a matter of checking for and then appending one record, then using "any" looks like the most straightforward. If the idea is to collect one representative of each value of element[0], and if the value is hashable, then yes, a set or dict is the best way to do it. -- http://mail.python.org/mailman/listinfo/python-list