def alias_diff(refcounts_before, refcounts_after):
 return set((t for t in refcounts_after if (refcounts_after[t] > refcounts_before.get(t, (-1)))))

def alias_diff ( refcounts_before , refcounts_after ) : return set ( ( t for t in refcounts_after if ( refcounts_after [ t ] > refcounts_before . get ( t , ( - 1 ) ) ) ) )
given the before and after copies of refcounts works out which aliases have been added to the after copy .