On 7 Feb 2016 21:51, "Paulo da Silva" <p_s_d_a_s_i_l_v_a...@netcabo.pt> wrote: > > Hello! > > This may not be a strict python question, but ... > > Suppose I have already a class MyFile that has an efficient method (or > operator) to compare two MyFile s for equality. > > What is the most efficient way to obtain all sets of equal files (of > course each set must have more than one file - all single files are > discarded)?
If you can make the MyFiles hashable then this is easily done with defaultdict(list). -- Oscar -- https://mail.python.org/mailman/listinfo/python-list