> Since what I _really_ wanted from this was the intersection of the
> objects (based on attribute 2), I was looking for a set-based
> solution,
> kinda like a decorate - <set operation> - undecorate pattern. Perhaps
> the problem does not fall into that category.

The "kinda" part is where the idea falls down.  If you've decorated
the inputs with a key function (like the key= argument to sorted()),
then the intersection step will return only a single element result,
not both matches as you specified in your original request.  IOW,
you cannot get set([(2, 1, 3), (1, 3, 3)]) as a result if both
set members are to be treated as equal.

It would be rather like writing set([1]).intersection(set([1.0]))
and expecting to get set([1, 1.0]) as a result.  Does your
intuition support having an intersection return a set larger
than either of the two inputs?


Raymond

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

Reply via email to